Simple User Registration Program

Source: Internet
Author: User
Keywords Simple User Registration Program
Tags php and mysql
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"
  • 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.