Home  >  Article  >  Backend Development  >  PHP user registration (perfect js verification at the front desk)_PHP tutorial

PHP user registration (perfect js verification at the front desk)_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:57:52963browse

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;

*/
?>





会员注册


会员注册









        



        



                                                                echo $_get['m_name'];
?>" />



                                                                                                                alone                                                                                                        
                                                                                                                                                                                                                                                        
              Female       *




​                                                                                                                                                                            input type = " text " name = " m_snum " id = " m_snum " value = " echo $_get['m_snum'];
?>" />



        



        


         

Account: (account)
* (consisting of 20 numbers or letters)
Password: (password)
         * (composed of 20 numbers or letters)
Confirm password(password)
        *(Enter password again)
Real name: (name)
Gender: (sex)
Student number: (school number)
Mobile phone number: (mobil phone)
E-mail: (email)

        


The above fields marked with "*" are required



register_get.php file



Tips

if(empty($_get['m_acct']))
echo "The account cannot be empty!Return and re-register.

";
else if(empty($_get['m_pw']))
echo "Password cannot be empty!Return Register.

";
else if($_get['m_pw']!=$_get['pass'])
echo "The passwords entered twice are different,Return to register again.

";
else if(empty($_get['m_sex']))
echo "No gender entered,
Return and re-register.

";
else if(!empty($_get['m_snum'])&&!is_numeric($_get['m_snum']))
echo "The student ID must be all numbers,Return to re-register.

";
else if(!empty($_get['m_pnum'])&&!is_numeric($_get['m_pnum']))
echo "Mobile phone numbers must be all digits,Return to re-register.

";
else if(!empty($_get['m_email'])&&!ereg("([0-9a-za-z]+)([@])([0-9a-za-z]+)(. )([0-9a-za-z]+)",$_get['m_email']))
echo "The email input is illegal!Return and re-register.

" ;
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 tutorial_query($sql)or die(mysql_error());
if($result>0)
echo "".$_get['m_name'].", Congratulations on your successful registration, Enter the main page immediately...

";
else
{
$_session['pass']="no pass";
echo "Registration failed!
Re-register.

";
mysql_close();
}
}
?>


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632043.htmlTechArticlephp user registration (front-end perfect js verification) php tutorial user registration (front-end perfect web page special effects verification) /* create table `member` ( `member_account` varchar(25) collate utf8_unicode_ci n...
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