EDIT: sorry for being a waste, I figured it out, it was an embarrassing html error
Hey guys I have a validation for required form fields in a sign up form. So I have a few required fields like first name, last name and email. My problem is that weather or not I actually put text into the required form fields my error check always states the field is empty! Please take a look at my code below.
PHP Code:
$errors = array();
$fname = mysql_escape_string($_POST['fname']);
if($fname == NULL) {
$errors[] = "First name field is empty.";
}
$errcount = count($errors);
if($errcount > 0) {
echo "The following errors occurred when your form was submitted:<br /><br />";
for($i=0; $i< $errcount; $i++) {
$errmsg .= $errors[$i]."<br />";
}
echo "<span class=\"hilite\">".$errmsg."</span>";
}else{
$querystring = "INSERT INTO...."