First step: First make a following page.
<title>Request Account</title>
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"