Beginners to consult, the purpose is to determine the form came over the data, if the blank prompt for the user and password, and do not execute down the SQL, if the form inside the data has a value to execute the following SQL statement, here first do not determine whether the form data is legitimate and so on.
$user =$_post[name]; Get the form name$pwd=$_post[passwd]; Get the form passwdif ($user = = ' && $pwd = = ') { //This place I do not know can be judged, if the user is equal to null, prompt for password echo ' Please enter user and password '; } else{ //If the above two is not empty, execute the following SQL statement and insert it into the database. $sql = "INSERT INTO (' $user ', ' $pwd ')"; mysql_query ($sql);}
Reply to discussion (solution)
if ($user = = "&& $pwd = =") {//here with | |
if (Empty ($use) | | Empty ($pwd)) {}
if (Empty ($use) | | Empty ($pwd)) {}
I only found out now that if you use | | This means that one is true, and I need to judge two of them to be true.
It's supposed to be && right.