Php + mysql implements user registration and login methods. Php + mysql implementation of user registration and login methods this article mainly introduces php + mysql implementation of user registration and login methods, can achieve simple user registration and login functions, some reference methods for implementing user registration and login using php + mysql
This article mainly introduces how to implement user registration and login in php + mysql. it can implement simple user registration and login functions and has some reference value. if you need it, you can refer
This example describes how to implement user registration and login in php + mysql. Share it with you for your reference. The specific analysis is as follows:
This is a user registration and login code implemented using php and mysql databases. it is also a simple and practical user registration program, and also adds the verification code program for user logon, the code is as follows:
The code is as follows:
Add users in the background
Require_once ("config. php ");
If (isset ($ _ post ["submit2"]) {
Mysql_select_db ('a0807000225 '); // This is a database table.
$ Author = $ _ session ["user_name"];
Define (all_ps, "jinquan ");
Echo $ username = $ _ post ["username"];
Echo $ password = md5 ($ password = $ _ post ["password"]. all_ps );
Echo"
";
If ($ username ){
If ($ password ){
$ Str = "insert into 'dx _ user_list '('uid', 'M _ id', 'username', 'password') values (ascii (null ), '1', '$ username',' $ password ');";
$ Rs = mysql_query ($ str, $ conn );
Mysql_close ($ conn );
}
If ($ rs ){
Echo "script" alert ('added successfully '); location. href = 'yonghuzc. php' script ";
} Else {
Echo "script" alert ('add failed'); location. href = ''yonghuzc. php' script ";
}
}
}
?>
I hope this article will help you with php programming.
This article mainly introduces how to implement user registration and login in php + mysql, which can implement simple user registration and login functions, with some reference...