PHP User Registration (front desk Perfect js verification) _php Tutorial

Source: Internet
Author: User
Tags mysql tutorial
PHP User Registration (front desk Perfect JS authentication)

PHP Tutorial User registration (Front desk Perfect page effect verification)
/*
CREATE TABLE ' member ' (
' Member_account ' varchar (+) collate utf8_unicode_ci NOT NULL,
' Member_password ' varchar (+) collate utf8_unicode_ci NOT NULL,
' member_name ' varchar (COLLATE) UTF8_UNICODE_CI NOT NULL,
' Sex ' varchar (1) Collate utf8_unicode_ci NOT NULL,
' Schoolnumber ' varchar (TEN) collate utf8_unicode_ci NOT NULL,
' PhoneNumber ' varchar (COLLATE) UTF8_UNICODE_CI NOT NULL,
' Email ' varchar (COLLATE) UTF8_UNICODE_CI NOT NULL,
Unique key ' Member_account ' (' Member_account ')
) Engine=innodb default Charset=utf8 collate=utf8_unicode_ci;

*/
?>





Member Registration


Member Registration


The above "*" is required



register_get.php file



Tips

if (Empty ($_get[' M_acct '))
echo "Account cannot be empty! Returns the re-registration.

";
else if (Empty ($_get[' M_PW ')))
echo "Password cannot be empty! Returns the re-registration.

";
else if ($_get[' M_PW ']!=$_get[' pass ')
echo "two times entered the password is not the same, return to re-registration.

";
else if (Empty ($_get[' m_sex ')))
echo "No gender entered, return to re-registration."

";
else if (!empty ($_get[' M_snum ') &&!is_numeric ($_get[' M_snum ']))
echo "School number must be all numbers, return to re-registration."

";
else if (!empty ($_get[' M_pnum ') &&!is_numeric ($_get[' M_pnum ']))
echo "Mobile phone number must be all numbers, return to re-registration.

";
else if (!empty ($_get[' M_email ') &&!ereg ("([0-9a-za-z]+) ([@]) ([0-9a-za-z]+) (.)] ([0-9a-za-z]+) ", $_get[' M_email '))
echo "Email entry is illegal! Returns the re-registration.

";
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, go to the homepage now ...

";
Else
{
$_session[' Pass ']= "no pass";
echo "Registration failed! Re-enroll.

";
Mysql_close ();
}
}
?>


http://www.bkjia.com/PHPjc/632043.html www.bkjia.com true http://www.bkjia.com/PHPjc/632043.html techarticle PHP User Registration (front desk Perfect js verification) PHP Tutorial user registration (Foreground perfect page effect verification)/* CREATE TABLE ' member ' (' member_account ' varchar) collate Utf8_unicode _ci N ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    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.