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 ...