Home >php教程 >php手册 >php用户注册(前台完美js验证)

php用户注册(前台完美js验证)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 09:57:52898browse

php用户注册(前台完美js验证)

php教程用户注册(前台完美网页特效验证)
/*
create table `member` (
  `member_account` varchar(25) collate utf8_unicode_ci not null,
  `member_password` varchar(32) collate utf8_unicode_ci not null,
  `member_name` varchar(20) collate utf8_unicode_ci not null,
  `sex` varchar(1) collate utf8_unicode_ci not null,
  `schoolnumber` varchar(10) collate utf8_unicode_ci not null,
  `phonenumber` varchar(15) collate utf8_unicode_ci not null,
  `email` varchar(50) collate utf8_unicode_ci not null,
  unique key `member_account` (`member_account`)
) engine=innodb default charset=utf8 collate=utf8_unicode_ci;

*/
?>





会员注册


会员注册


 
   
     
     
   
   
     
     
   
   
     
     
   
   
     
     
   
   
     
     
   
   
     
     
   
   
     
     
   
   
     
     
   
   
     
   
 
账号:(account)
   *(由20个数字或字母组成)
密码:(password)
      *(由20个数字或字母组成)
确认密码(password)
      *(再次输入密码)
真实姓名:(name)
性别:(sex)


       
       

学号:(school number)
手机号码:(mobil phone)
电子邮箱:(email)

     


以上打"*"为必填项



register_get.php文件



提示

if(empty($_get['m_acct']))
echo "账号不能为空!返回重新注册。";
else if(empty($_get['m_pw']))
echo "密码不能为空!返回重新注册。";
else if($_get['m_pw']!=$_get['pass'])
echo "两次输入的密码不一样,返回重新注册。";
else if(empty($_get['m_sex']))
echo "未输入性别,
返回重新注册。";
else if(!empty($_get['m_snum'])&&!is_numeric($_get['m_snum']))
echo "学号必须全为数字,返回重新注册。";
else if(!empty($_get['m_pnum'])&&!is_numeric($_get['m_pnum']))
echo "手机号码必须全为数字,返回重新注册。";
else if(!empty($_get['m_email'])&&!ereg("([0-9a-za-z]+)([@])([0-9a-za-z]+)(.)([0-9a-za-z]+)",$_get['m_email']))
echo "邮箱输入不合法!返回重新注册。";
else
{
require_once ('inc.php');
$_session['pass']="ok";
$_session['member']=$_get['m_acct'];
$link = getdblink();
$sql="insert into member values('".$_get['m_acct']."','".md5($_get['m_pw'])."','".$_get['m_name']."','".$_get['m_sex']."','".$_get['m_snum']."','".$_get['m_pnum']."','".$_get['m_email']."')";
$result=mysql教程_query($sql)or die(mysql_error());
if($result>0)
echo "".$_get['m_name'].",恭喜你注册成功,马上进入主页面...";
else
{
 $_session['pass']="no pass";
 echo "注册失败!
重新注册。";
 mysql_close();
}
}
?>


Statement:
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