$_getGet the parameter value in a GET request$username=$_get["UserName"];$password=$_get["Password"];Echo("Username:".$username."Password:".$password) *///POST request, open Web page no value//Gets the value of the two variables in the body body,/*$username=$_post["username"];$password=$_post["Password"];if($username=="Houzhichao"&&$password==12345) {$dic= Array ("Code"= $,"Message"="Login Successful");Echo(Json_encode ($dic)); }Else{$dic= Array ("Code"=404,"Message"="Login Failed");Echo(Json_encode ($dic)); }*///register with the database to use, the foreground write something, write to the server database//1. Gets the value of the parameter in the user get body$username=$_get[Username];$password=$_get[password];//2. Using the database//(1) Connection Database mysql_connect//parameters1: Service//Parameters2: User name of login database, we select root user//parameter3: Password, when empty, can save//* * has a return value BOOL$islink= Mysql_connect ("127.0.0.1","Root","");if($islink) {Echo("Database connection succeeded
"); // (2) Select Database mysql_select_db mysql_select_db ("DataBase"); // (3Query the user table in the database, there is no current user name; return value (instruction set or BOOL) mysql_query//Results is an array (all records), querying all the contents$results= mysql_query ("Select username from users"); while($row= Mysql_fetch_array ($results) {//Determine if the user name in the row record is the same as the currently registered user nameif($row["username"] ==$username) {Echo("Registration failed, user name already exists
");return; }}//can register the operation//the equivalent of inserting data into a table of users$result= mysql_query ("INSERT into users (Username,password) VALUES ('$username', '$password')");if($result) {Echo("Registration Successful
"); }Else{Echo("Registration failed
"); }}Else{Echo("link Failed");}? >
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above introduces the PHP background database and the foreground request to combine, including the aspect of the content, I hope that the PHP tutorial interested in a friend helpful.