About the PHP registration page, did not run to check whether user input meets the requirements of this step, ask the big God to point out where the error?
PHP Code
User notes: Please read the following terms carefully:
----------------
----Agreement content----
----------------
Agree not to agree
"; $str 2 =" "; Determines how the next process $msg =$_get["message" based on the value of the message; if (!isset ($msg)) $msg =$_post["message"]; if ($msg = = ' new ') {echo $str 1; Exit (); }elseif ($msg = = ' Agree ') {echo $str 2; Exit (); }elseif ($msg = = ' reg ') {//Check whether the user's input conforms to the requirements $username =$_post["username"]; $password =$_post["passwd"]; $REPASSWD =$_post["REPASSWD"]; $passwda =$_post["PASSWDPA"]; $PASSWDQ =$_post["PASSWDQ"]; if ($username = = "" | | $password = "" | | $repasswd = "" | | $PASSWDQ = "" | | $passwda = "") {echo ' Required fields cannot be empty! "; if ($password! = $repasswd) {echo ' password is not the same! "; }//Check the database for the presence of a user with the same name $conn = @mysql_connect ("localhost", "root", "") or Die ("failed-Connect to database"); mysql_select_db ("project", $conn); $sql = "Select username from member WHERE usename= ' $username '"; $result =mysql_query ($sql); if (Mysql_fetch_object ($result)) {mysql_close ($conn); echo "User name already exists!"; }//user data is inserted into the database $sql = ' INSERT INTO member (username,password,userpassq,userpassa,email,telephone,addres s) VALUES ('. $_post[' username ']. ', '. $_post[' passwd ']. ', '. $_post[' PASSDP ']. ', '. $_post[' PASSDA ']. ', '. $_post[' em Ail ', ', '. $_post[' Tel ']. ', '. $_post[' addr ']. if (mysql_query ($sql)) {$sql 2= "SELECT id from Member WHERE username= ' $username '"; $result =mysql_query ($sql 2); $res =mysql_fetch_object ($result); $id = $res->id; Session_register ($memberid); $reuturnpage = "Location:loginscreen.php?username= ' $username '"; Mysql_close ($conn); Header ($returnpage); }else{mysql_close ($conn); Header ("location:register.php?message=". UrlEncode ("Registration failed! Please retry ")); Exit }}else{$msg =$_get["message"]; Echo $msg; Exit (); }}//page section?> <title>User Registration page</title>