Step two: Register the execution program.
mysql_connect ("localhost", "username", "password")/* Please modify your username and password */
Or Die ("Cannot connect to database, please repeat");
mysql_select_db ("Database name")
Or Die ("cannot select the database, please repeat");
$query = "SELECT id from database table name where username= ' $name '";
/* Users looking for the same name from the database */
$result =mysql_query ($query);
$numrows =mysql_num_rows ($result);
if ($numrows!=0)
/* If the same user is found, the following prompt appears. */
{
$temp = ' Someone has registered this name, please re-select the name! ';
}
Else
{
if ($word! = $pass)
{
$temp = "Inconsistent password input! ";
}
Else
{
if (!eregi ("^[a-z][a-z0-9_.") {3,19}$ ", $name))
{
$temp = "User name is illegal.";
}
Else
{
$query = "INSERT into Memberauth values (' 0 ', ' $name ', ' $word ', ' 1 ', ' $ask ', ' $answer ')"; /* Enter a new user profile if the same is not found */
mysql_query ($query);
$temp = "
Close Window ";
}
}
}
?>
<title>Request Account</title>
I am a beginner of PHP and MySQL, hope that the Alliance support. If you want to implement this procedure, please go to htpp://lyjrich.oso.com.cn to register to know. or write to me lyjrich@sina.com.
"The copyright of this article is owned by the author and house Orso near net, if need to reprint, please specify the author and source"
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.