Page styles apply the bootstrap framework.
First look at the login page (login page for account login, you can also jump to the Registration Account page):
<! DOCTYPE html> Registered account's front page:
<! DOCTYPE html>Background processing code for registered account:
<?phpheader ("Content-type:text/html;charset=utf-8");//received foreground data $str=$_post["FormData"];list ($userName, $pwd, $ REPWD) =explode ("&", $str), if (strlen ($userName) >9&&strlen ($pwd) >4&& $rePwd = = $pwd) {echo " True "; $str. =" [;] ";
For convenience, the registration information is stored in a use.txt file, there is no related operation of the database, and the way in which the data is stored is so file_put_contents ("User.txt", $str, File_append);} Else{echo "false";}
Background processing code for login account:
<?phpheader ("Content-type:text/html;charset=utf-8"), $str = $_post["FormData"];list ($userName, $pwd) = Explode (" & ", $str); $users = file_get_contents (" User.txt "), $USERARR = explode (" [;] ", $users); foreach ($userArr as $user) {list ($realName, $realPwd) = Explode ("&", $user), if ($userName = = $realName && $pwd = = $realPwd) {echo "true";d ie ();}} echo "false";
Home page after successful login:
<! DOCTYPE html>Add a comment to the background processing code:
<?phpheader ("Content-type:text/html;charset=utf-8"); $userName = $_post["UserName"]; $time = $_post["Time"];$ Noteval = $_post["Noteval"];//the information obtained by the foreground is stored as an associative array $arr = ["userName" + = $userName, "Time" = $time, "Noteval" =>$ noteval];//Save the array as a JSON object {"UserName": $userName, "Time": $time, "Noteval": $noteVal} $str = Json_encode ($arr);//Will $ STR is deposited in the Note.txt file $num = file_put_contents ("Note.txt", $str. " [;] ", file_append); if ($num >0) {echo" true ";} Else{echo "false";}
To display the message content to the foreground page of the background processing code:
<?phpheader ("Content-type:text/html;charset=utf-8");//Get the contents of the file in the Echo file_get_contents ("Note.txt");
Jquery+php realizes simple front-back and back-table data Interactive Implementation Registration login, add message function