In Register.php, it contains a form.
<html>
<body>
<form action="Insert.php" method="post">
Email: <input type="text" name="email" /><br/>
Username: <input type="text" name="username" /><br/>
<input type="submit" name="Send Registration" value="Send Registration"/>
</form>
</body>
</html>
In Insert.php, it contain codes that do some validations.
<?php
if(!filter_var($_POST[email], FILTER_VALIDATE_EMAIL))
{
exit("E-mail is not valid");
}
else
{
if(!strlen($_POST[username])>=6)
{
exit("Username should be at least 6 characters");
}
else
{
// Continue other validations
}
}
?>
When i enter an invalid email address a click on 'send registration', it will show the error message "E-mail is not valid". So, i tried to enter a valid email address and key in 5 or lesser characters in the username field and click on 'send registration'. But it doesn't show the error message.
May i know what is wrong with my codes?
Sorry i am a beginner in programming and php.
Thanks in advance!