Now a day email_id become compulsory for any type of registration. Here i will show you how to use email field in registration form and how to validate it for wrong entry of email. Php has inbuilt function to validate the email.
html code (emailvalid.php)
php code (valid.php)
The function check( ) is define to restrict the user to enter special characters. It also restrict user to perform anti programming so that your website does't get hacked.
The function strtolower( ) is used to convert the string into lower case. You have seen many time that by mistake when you enter your email address in upper case it get auto converted into lower case. The function strtolower( ) is used behind that to convert the string to lower case. Only then your email get valid for your login or for any type of registration.
The FILTER_VALIDATE_EMAIL function is Php inbuilt function it validate the email parameters likes dot, @ sign and the complete structure of email. It monitor all the sign and letters present in the email are pleased at the right place or not.
No comments:
Post a Comment