Home > Backend Development > PHP Tutorial > 写了个简单的注册页面,可填完表单,点击提交,页面没有反应解决方法

写了个简单的注册页面,可填完表单,点击提交,页面没有反应解决方法

WBOY
Release: 2016-06-13 13:29:41
Original
2611 people have browsed it

写了个简单的注册页面,可填完表单,点击提交,页面没有反应
填完表单,点击提交,页面没有反应
代码:


register page


if(!empty($_POST['submit']))
{
  $username=$_POST['username'];
  $password=$_POST['password'];
  $verify_ps=$_POST['verify_ps'];
  $email=$_POST['email'];
  $qq=$_POST['qq'];
}
if(!isset($_POST['username'],$_POST['password'],$_POST['verify_ps'],$_POST['email']))
{
?>

 

  user information:
  user acount:
 


 
 
 


 


 
 
 


 


 
 
 

 
 contact information:
 


 
 
 


 


 
 
 


 
 


}
else{
  $mysql=new mysqli('localhost','webuser','123456');
if(!$mysql)
{  
echo "can't connect to db.";
exit;
}
$select=$mysql->select_db('user',$mysql);//设定与链接标识符(这里是$mysql)相关联的当前激活数据库
if(empty($select))
{
die("can't select to db.");
}
$s_username="select name='".$username."'from picuser";
$s_email="select e_mail='".$email."'from picuser";
$name_result=$mysql->query($s_username);
$email_result=$mysql->query($s_email);
$n_row=$name_result->fetch_row();
$e_row=$email_result->fetch_row();
if($n_row||$e_row){
echo "this username has been registered." ;  
exit;
}
$insert_user="insert into picuser(name,password,e_mail,qq) values ('".$username."','".$password."','".$email."','".$qq."')";
$insert_result=$mysql->query($insert_user); 
if($insert_result)
{
die('insert data is fail.');
}else{
echo "you has registered successful!";
}
}
?>



------解决方案--------------------
表单写规范点啦。

------解决方案--------------------
把表单跟PHP分开写不是好点吗?用P标签 ?用teble是不是有意义一点呢!
------解决方案--------------------
有点长呵呵,将html和php分离点比较好
Related labels:
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