php使用者註冊(前台完美js驗證)_PHP教程

來源:互聯網
上載者:User
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;

*/
?>





會員註冊


會員註冊


以上打"*"為必填項



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();
}
}
?>


http://www.bkjia.com/PHPjc/632043.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/632043.htmlTechArticlephp使用者註冊(前台完美js驗證) php教程使用者註冊(前台完美網頁特效驗證) /* create table `member` ( `member_account` varchar(25) collate utf8_unicode_ci n...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.