A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: [RESOLVED] Error check says form field empty...but its not!

Hybrid View

  1. #1
    Member
    Join Date
    Feb 2009
    Posts
    49

    resolved [RESOLVED] Error check says form field empty...but its not!

    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...." 
    Last edited by rogueblade; 11-22-2009 at 03:51 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center