I have a registration form and I can't get error messages to show on the same page as the form. Errors such as 'first name empty' when the field is blank.
I have codes such as:
Code: Select all
if (strlen($_POST['name']) < 5)
{
die ("Incorrect email. Please enter valid email address..");
}I have tried changing the code in the 2 following ways:
Code: Select all
if (strlen($_POST['name']) < 5)
{
echo ("Incorrect email. Please enter valid email address..");
}Code: Select all
if (strlen($_POST['name']) < 5)
{
$error = "Incorrect email. Please enter valid email address..";
}
echo ("$error");Can anyone see where I am going wrong?