Created
May 22, 2017 09:34
-
-
Save rintoug/29c9f7542b7697207ad3b8ab40efb377 to your computer and use it in GitHub Desktop.
PHP User Registration Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Form validation | |
| /* Form Required Field Validation */ | |
| foreach($_POST as $key=>$value) { | |
| if(empty($_POST[$key])) { | |
| $error[] = "All Fields are required"; | |
| break; | |
| } | |
| } | |
| /* Email Validation */ | |
| if (!filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) { | |
| $error[] = "Invalid Email Address"; | |
| } | |
| /* Password Match Validation */ | |
| if($_POST['password'] != $_POST['confirm_password']){ | |
| $error[] = 'Passwords does not match'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment