name.php
注册用户
用户名:
姓名:
密码:
确认密码:
email:
进入:
tenglu
join.php
$userid=$_POST['userdi'];
$name=$_POST['user'];
$password=$_POST['password'];
$password2=$_POST['password2'];
$email=$_POST[''email];
function show($msg){
echo "
$msg
";echo "
";echo "
}
if(empty($userid)||empty($passowrd)||empty($name)||empty($email){
show("该项目不能为空");
exit;
}
if($password !== $passowrd2){
show('两次密码不一致');
exit;
}
mysql_connect("localhost","root","");
$db=mysql_select_db("tutor");
$aql="select * from user where useid=''";
$row=mysql_query($aql);
$num=mysql_num_rows($row);
if($num!=0){
show("用户名以存在,请重新输入");
exit;
}
$aql="select * from user where email=''";
$row=mysql_query($aql);
$num=mysql_num_rows($row);
if($num!=0){
show("email以存在,请重新输入");
exit;
}
$sql="insert into users values($userid,$password,$name,$email)";
mysql_query($sql);
show('注册成功');
?>
自己看看那不一样吧
取消
评论