PHP User Registration page Code This user registration process includes a database, registration page, Registration JS authentication is a php+mysql practical user registration code.
PHP Tutorial User Registration page code
This user registration program is a database tutorial, registration page, registration page effect verification is a finishing Php+mysql tutorial practical user Registration code.
*/
$conn =mysql_connect (' localhost ', ' root ', ' root ') or Die (' Database connection error ');
mysql_select_db (' demo ', $conn);
mysql_query ("Set names ' GBK '");
Detect if a member name exists
if ($_post[username]) {
$sql = "SELECT * from Users where username= ' $_post[username] '";
$res =mysql_query ($sql) or Die ("Query failed! ");
$US =$_get[name];
echo $US. " 222222 ";
$ps tutorial = MD5 ($_post[password]);
$sex =$_post[' sex '];
$age =$_post[' age ';
$QQ =$_post[' QQ '];
$phone =$_post[' phone '];
$email =$_post[' email '];
$address =$_post[' address ';
if (Is_array (Mysql_fetch_row ($res))) {
echo "The member name already exists!" ";
}else{
$sql = "INSERT into users (username,password,sex,age,qq,phone,email,address) VALUES (' $US ', ' $ps ', $sex, $age, $QQ, ' $ Phone ', ' $email ', ' $address ');
Echo $sql;
mysql_query ($sql) or Die ("registration failed");
echo "";
}
}
?>
/*
Drop table if exists ' users ';
CREATE table ' users ' (
' id ' int () NOT NULL auto_increment,
' username ' varchar () is not null,
' password ' V Archar (a) NOT null,
' sex ' int (1) is not NULL for default ' 0 ',
' age ' int (ten) not NULL,
' QQ ' int (+) ' default null '
' phone ' varchar default NULL,
' email ' varchar (+) default NULL,
' address ' varchar (+) default NULL,
Prim ary key (' id ')
) engine=innodb auto_increment=4 default CHARSET=GBK;
-- ----------------------------
--Records of users
-- ----------------------------
Insert INTO ' users ' values (' 1 ', ' admin ', ' 21232f297a57a5a743894a0e4a801fc3 ', ' 0 ', ' 22 ', ' 379559090 ', ' 666666 ', ' 666666@1 63.com ', ' Wuhan ');
Insert INTO ' users ' values (' 2 ', ' root ', ' 63a9f0ea7bb98050796b649e85481845 ', ' 0 ', ' 20 ', ' 1244249796 ', ' 8888888 ', ' 8888888 @163.com ', ' China ');
Insert INTO ' users ' values (' 3 ', ' www.bKjia.c0m ', ' 96e79218965eb72c92a549dd5a330112 ', ' 0 ', ' 20 ', ' 1244249796 ', ' 8888888 ') , ' 8888888@163.com ', ' China ');
Download the address for this tutorial
Http://down.bKjia.c0m/down/code/php/xinwenxitong/2010/0812/20183.html
http://www.bkjia.com/PHPjc/632046.html www.bkjia.com true http://www.bkjia.com/PHPjc/632046.html techarticle PHP User Registration page Code This user registration process includes a database, registration page, Registration JS authentication is a php+mysql practical user registration code. PHP Tutorials ...