This is a section using PHP and mysql database tutorials to achieve user registration and login code Oh, the function is relatively simple and practical user registration procedures Oh. At the same time also added when the user login verification code program, this is a lot of safety Oh.
* /
?>
<! doctype html public "- // w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.jzread.com/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text / html; charset = gb2312" />
<title> Add users </ title> in the background
</ head>
<body>
<? php
require_once ("config.php");
if (isset ($ _ post ["submit2"])) {
mysql_select_db ('a0807000225'); / / this is the database table
$ author = $ _ session ["user_name"];
define (all_ps tutorial, "jinquan");
echo $ username = $ _ post ["username"];
echo $ password = md5 ($ password = $ _ post ["password"]. all_ps);
echo "</ br>";
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 ('add new'); location.href = 'yonghuzc.php' </ script>";
} else {
echo "<script> alert ('new failed'); location.href = '' yonghuzc.php '</ script>";
}
}
}
?>