My php code is not working. It is showing wrong messages. For example if I fill the email address longer than 10 characters, then it still shows that my field is empty.
<?php
$errors = array();
if (isset($_POST['submit'])) {
$name = htmlentities(mysql_real_escape_string($_POST['name']));
$email = htmlentities(mysql_real_escape_string($_POST['email']));
$ip = $_SERVER['REMOTE_ADDR'];
if (strlen($email) > 10) {
echo 'ok';
}
else {
echo 'empty';
}
}
?>
mysql_, learn/use mysql or PDOvar_dump($_POST['email']);before the$name