My Forum source code eight

Source: Internet
Author: User
reguse.php User Registration and Login page
if ($action ==dl&& $uname)
{
$uinfo = $uname. "|". $upass;
Setcookie ("Flyfoxnet", $uinfo, Time () +3600);
}
?>


<title>User Registration</title>




Include "linkfox.inc.php";
Include "info.inc.php";
Include "reguse.inc.php";
function Dlokey ($user)//Login Successful display
{
echo "";
echo "
"; echo "


"; echo " "; echo "
";
echo "Welcome you!" ". $user [3]."
";
echo "The last time you visited this site was:". $user [2]. "
You can now <发布新帖> <查看主题> <修改信息>
";
}
?>
































Current Location: Fox network ─> Fox Network Forum ─> member registration







if ($action ==xy)
{
echo "
";
echo "

"; echo " "; echo "
Fox Network Forum Rules
";
echo "

Your registration in this forum is completely free! We hope that you will abide by the following forum rules. Please read the following terms carefully. If you agree, please press the ' I agree ' button. If you do not agree, ";
echo "Please press the ' disagree ' button to exit.

";
echo "

1. Abide by the relevant laws and regulations of the People's Republic of China.

";
echo "

2. No expression of pornographic illegality or of endangering national security shall be issued.

";
echo "

3. Links to illegal information about politics, pornography, religion, superstition, etc. are strictly forbidden.

";
echo "

4. Assume all civil or criminal liabilities arising directly or indirectly from your conduct;

";
echo "

5. Respect each other and abide by Internet ethics; Prohibit each other malicious attacks, abusive;

";
echo "

6. Administrators and moderators have the right to retain or delete any content in the forum;

";
echo "

7. This site network management has all the administrative power.

";
echo "

8. The original article published in this forum, the copyright rule author and fox nets are common.

";
echo "
";
echo "
";
echo "";
echo "";
}
else if ($action ==reg)
{
Usemess ("Please fill in the form below the registration information", ' must fill ', ' must fill ', ' must fill ', ' must fill ', ' must fill ', ' must fill ', ' must fill ');
}
if ($action ==add)
{
if ($useni)//If there is information
{
for ($i =0; $i <10; $i + +)
{
if ($BQ [$i]) $USEBQ = $BQ [$i];
}
$reginfo =reg ($usename, $usepass, $usemail, $useweb, $useni, $useoicq, $usesex, $useage, $usezy, $useaddr, $useinf, $usety , $USEBQ, $USEQM);
Switch ($reginfo)
{
Case ($reginfo ==1):
Usemess ("Error! User name is very long", $usename, $usemail, $useweb, $useni, $useoicq, $useaddr, $USEQM);
Break
Case ($reginfo ==2):
Usemess ("Error! Password extra Long", $usename, $usemail, $useweb, $useni, $useoicq, $useaddr, $USEQM);
Break
Case ($reginfo ==3):
Usemess ("Error!OICQ illegal", $usename, $usemail, $useweb, $useni, $useoicq, $useaddr, $USEQM);
Break
Case ($reginfo ==4):
Usemess ("Error! User password contains illegal characters", $usename, $usemail, $useweb, $useni, $useoicq, $useaddr, $USEQM);
Break
Case ($reginfo ==5):
Usemess ("Error! User name contains illegal characters", $usename, $usemail, $useweb, $useni, $useoicq, $useaddr, $USEQM);
Break
Case ($reginfo ==6):
Usemess ("Error! Illegal OICQ number", $usename, $usemail, $useweb, $useni, $useoicq, $useaddr, $USEQM);
Break
Case ($reginfo ==7):
Usemess ("Error! Illegal email address", $usename, $usemail, $useweb, $useni, $useoicq, $useaddr, $USEQM);
Break
Case ($reginfo ==8):
Usemess ("Very sorry! This user already exists, please re-select ", $usename, $usemail, $useweb, $useni, $useoicq, $useaddr, $USEQM);
Break
Case ($reginfo ==9):
Usemess ("Unknown error! ", $usename, $usemail, $useweb, $useni, $useoicq, $useaddr, $USEQM);
Break
Case ($reginfo ==10):
Usemess ("Write database error, please contact Dark lay", $usename, $usemail, $useweb, $useni, $useoicq, $useaddr, $USEQM);
Break
Default
$reginfo =update ($reginfo);
Regok ("Registration is successful, the following is your personal information", $reginfo);
Break
}
}
else usemess ("Please fill in your information", ' required ', ' required ', ' required ', ' must fill ', ' required ', ' required ', ' required ');
}
if ($action ==dl)//Login function
{
if ($uname)
{
$query = "Select Usepass,usename,enddate,useni from Useinfo where Usename= '". $uname. "'"; Checks if a user exists
$req = @mysql_query ($query);
if ($req)
{
$user = @mysql_fetch_array ($req);
if ($user [0]== $upass)//Check if the password is correct
{
$time =date (y year N month J Day g time I);
$query = "Update useinfo set enddate= ' $time ' where usename= '". $uname. "";
$req = @mysql_query ($query);
if ($req) Dlokey ($user);
else Dlmes ("Data login Error!");
}
Else Dlmes ("The user password is not correct, please verify!") ");
}
else Dlmes ("Cannot find user information, please confirm! If not registered, please click here");
}
else dlmes ("User login");
}
?>

The above is the introduction of my forum source code eight, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

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