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

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

Jun 13, 2016 am 09:57 AM
creatememphptablePerfectTutorialUser registrationWeb special effectsverify

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)