PHP user registration page code_PHP tutorial

WBOY
Release: 2016-07-13 10:58:06
Original
1283 people have browsed it

php user registration page code This user registration program is a complete and practical php+mysql user registration code that includes a database, registration page, registration js verification.

php tutorial user registration page code
This user registration program is a practical user registration code that includes database tutorials, registration pages, registration web page special effects, and verification. It is a complete php+mysql tutorial.
*/

$conn=mysql_connect('localhost','root','root')or die('Database connection error');
mysql_select_db('demo',$conn);
mysql_query("set names 'gbk'");
//Check whether the 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 "<script>alert('Registration successful');location.href='login.php'</script>";
}
}
?>


 


  会员名称:
 

 

  密    码:
 

  确认密码:
 

性别:
男:
女:

年龄:

qq:

电话:

email:

地址:

 
 
 

/*

drop table if exists `users`;
create table `users` (
  `id` int(10) not null auto_increment,
  `username` varchar(50) not null,
  `password` varchar(50) not null,
  `sex` int(1) not null default '0',
  `age` int(10) not null,
  `qq` int(15) default null,
  `phone` varchar(50) default null,
  `email` varchar(50) default null,
  `address` varchar(100) default null,
  primary 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@163.com', '武汉');
insert into `users` values ('2', 'root', '63a9f0ea7bb98050796b649e85481845', '0', '20', '1244249796', '8888888', '8888888@163.com', '中国');
insert into `users` values ('3', 'www.bKjia.c0m', '96e79218965eb72c92a549dd5a330112', '0', '20', '1244249796', '8888888', '8888888@163.com', '中国');


本教程下载地址

http://down.bKjia.c0m/down/code/php/xinwenxitong/2010/0812/20183.html

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/632046.htmlTechArticlephp 用户注册页面代码这款用户注册程序是一款包括有数据库,注册页面,注册js 验证是一款完整理的php+mysql实用的用户注册代码。 php教程...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!