Let me take a look at it. verification code is incorrect when I lose it!
Script
Function check (){
Var psw1 = document. getElementById ("psw1 ");
Var psw2 = document. getElementById ("psw2 ");
If (psw1.value! = Psw2.value)
Psw2.setCustomValidity ("two passwords inconsistent ");
Return false;
}
Script
Login | registration
Welcome to registration
User name:
Password & nbsp code:
Confirm password:
Mail & nbsp box:
Placeholder = "enter the correct email format" name = "email">
Verification code:
Require ('03. php ');
?>
I have read and agree to this agreement
Book terms
002. php
If (isset ($ _ POST ['submit ']) {
Session_start ();
$ Checkstr = $ _ SESSION ['yzm']; // use the $ _ SESSION variable to obtain the verification code on the 03. php page.
$ Str = $ _ POST ['check']; // user-input string
If (strcasecmp ($ str, $ checkstr )! = 0) // case-insensitive comparison
Echo "script" alert ('verification code is incorrect! '); Script ";
Else {
$ Conn = mysql_connect ("localhost", "root", "123456 ");
Mysql_query ("set names 'utf8 '");
Mysql_select_db ("book", $ conn );
$ Username = $ _ POST ["username"];
$ Password = $ _ POST ["psw1"];
$ Email = $ _ POST ["email"];
$ SQL = "insert into register (username, password, email) VALUES ('$ username',' $ password ',' $ email ')";
$ Result = mysql_query ($ SQL );
If ($ result ){
Session_start ();
$ _ SESSION ['username'] = $ username;
Print ("