PHP verification code problem !!! Solution ~~~~ I generated a verification code in code. php! How can I verify the consistency with the generated verification code in the text box when I arrive at the front-end! Your blog.sina.com. cnsblog _ PHP verification code !!! Solution ~~~~
I generated a verification code in code. php!
How can I verify the consistency with the generated verification code in the text box when I arrive at the front-end!
------ Solution --------------------
Http://blog.sina.com.cn/s/blog_8b31d4dd010160fz.html
Http://blog.sina.com.cn/s/blog_8b31d4dd010160fp.html
You can see it.
------ Solution --------------------
Use SESSION to save the verification code string and write a verification page for verification.
------ Solution --------------------
Yes. all of the above are good methods. you can learn from them!
------ Solution --------------------
The php script of the image generates an image and saves the verification code in the SESSION. The php form can be verified.
------ Solution --------------------
If ($ ps & ($ _ POST ["code"] === _ SESSION ["code"]) {
$ _ SESSION ['name'] = $ row ['name']; // Obtain the name and store it in the SESSION.
$ _ SESSION ['User _ Shell'] = md5 ($ row ['email ']. $ row ['password']. ALL_PS); // Here, the account and password are encrypted at the first layer.
$ _ SESSION ['Times '] = mktime ();
Echo "Hello:". $ row ['name']. "Welcome back! "." Exit ";
} Elseif (! $ Ps ){
Echo "use your name or password to encrypt your records! "."
";
}
Elseif ($ _ POST ["code"]! = $ _ SESSION ["code"]) {
Echo "your certificate has been renewed! ";
}
Session_destroy ();
}