Source code of my Forum (8)

Source: Internet
Author: User

Reguse. php user registration and logon page

<?
If ($ action = dl & $ uname)
{
$ Uinfo = $ uname. "|". $ upass;
Setcookie ("FlyFoxNet", $ uinfo, time () + 3600 );
}
?>
<Html>
<Head>
<Title> User Registration </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<STYLE type = text/css>
P {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt}
DIV {FONT-FAMILY: normal; FONT-SIZE: 9pt; LINE-HEIGHT: 14pt}
</STYLE>
<LINK href = "js/cpcw.css" rel = stylesheet/LINK>
</Head>
<? Php
Include "linkfox. inc. php ";
Include "info. inc. php ";
Include "reguse. inc. php ";

Function dlokey ($ user) // The logon succeeds.
{
Echo "<script language = 'javascript '> alert ('". $ user3. "welcome to the fox web forum again, webmaster flying fox | welcome to the dark monk! Your last visit was ". $ user [2]." '); </script> ";
Echo "<table width = '000000' border = '0' cellspacing = '0' cellpadding = '0' align = 'center' bgcolor = '# 50%'> ";
Echo "<tr> <td> <table width = '000000' border = '0' cellspacing = '1' cellpadding = '1'> <tr bgcolor = '# 100%'> <td> ";
Echo "<div align = 'center'> <font color = '# ffff'> welcome! <Font color = '00ff00'> ". $ user [3]. "</font> </div> </td> </tr> <tr bgcolor = '# eeeeee'> <td> ";
Echo "<div align = 'center'> the last time you visited this site was: <font color = '000000'> ". $ user [2]. "</font> </div> </td> </tr> <tr bgcolor = '# eeeeeeee'> ";
Echo "<td> <div align = 'center'> now you can <a href = 'Post. php'> <publish new posts> </a> <a href = 'foxbbs. php'> <view topic> </a> <a href = 'useinfo. php? Action = edit'> <modify information> </a> </div> </td> </tr> ";
Echo "</table> </td> </tr> </table> ";
}

?>
<Body bgcolor = "# FFFFFF">
<Table width = "100%" cellpadding = "4" cellspacing = "0" border = "0">
<Tr>
<Td height = "20">
<Div align = "right"> </div>
</Td>
<Td height = "20" width = "75"> </td>
<Td height = "20" width = "75"> </td>
<Td height = "20" width = "75"> </td>
<Td height = "20" width = "75"> </td>
</Tr>
<Tr>
<Td height = "20">
<Div align = "right"> </div>
</Td>
<Td height = "20" width = "75">
<Div align = "center"> </div>
</Td>
<Td height = "20" width = "75">
<Div align = "center"> </div>
</Td>
<Td height = "20" width = "75"> </td>
<Td height = "20" width = "75"> <a href = "okey. php? D = q "> </a> </td>
</Tr>
<Tr>
<Td height = "20">
<Div align = "left"> current location: <font color = "# 0000FF"> foxnet Forum> Member registration </font> </div>
</Td>
<Td height = "20" width = "75">
<Div align = "center"> <a href = "foxbbs. php "> </a> </div>
</Td>
<Td height = "20" width = "75">
<Div align = "center"> <a href = "post. php "> </a> </div>
</Td>
<Td height = "20" width = "75"> <a href = "superuse. php "> </a> </td>
<Td height = "20" width = "75">
<Div align = "center"> <a href = ".. /index. php "> </a> </div>
</Td>
</Tr>
</Table>
<?
If ($ action = xy)
{
Echo "<table width = '000000' border = '0' cellspacing = '0' cellpadding = '0' bgcolor = '# 000000'> <tr> <td> ";
Echo "<table width = '000000' border = '0' cellspacing = '1' cellpadding = '1'> ";
Echo "<tr bgcolor = '#006699'> <td height = '20'> <div align = 'center'> <font color = '# ffff'> Fox Forum rules </font> </div> </td> </tr> ";
Echo "<tr bgcolor = '# eeeeee'> <td height = '20'> ";
Echo "<div align = 'left'> <p> you registered on this forum for free! We hope that you will abide by the following Forum rules. Please read the following terms carefully. If you agree, please click the 'I agree' button. If you do not agree ,";
Echo "click" disagree "to exit. </p> ";
Echo "<p> 1. comply with the relevant laws and regulations of the People's Republic of China. </p> ";
Echo "<p> 2. Do not post any illegal pornographic content or comments endangering national security. </p> ";
Echo "<p> 3. Do not link illegal information such as politics, pornography, religion, and superstition. </p> ";
Echo "<p> 4. Assume all civil or criminal legal liabilities that are directly or indirectly caused by your behavior. </p> ";
Echo "<p> 5. Mutual respect and adherence to the Internet ethics; mutual malicious attacks and abuse are prohibited; </p> ";
Echo "<p> 6. The administrator and moderator have the right to retain or delete any content in the forum. </p> ";
Echo "<p> 7. The website administrator has all management powers. </p> ";
Echo "<p> 8. original articles published in this forum are shared by the authors of copyright regulations and Hu net. </P> ";
Echo "</div> </td> </tr> </table> ";
Echo "</td> </tr> </table> ";
Echo "<div align = 'center'> <form action = 'reguse. php 'method = 'get'> <input type = 'den den 'NAME = 'action' VALUE = 'reg'> ";
Echo "<input type = 'submit 'VALUE =' I agree '> </p> </form> ";
Echo "<div align = 'center'> <form action = 'foxbbs. php 'method = 'get'> <input type = 'submit 'VALUE = 'disagree'> </p> </form> ";
}
Else if ($ action = reg)
{
Usemess ("Please fill in registration information in the following table", 'mandatory ', 'required ', 'required ');
}
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! The user name is too long ", $ usename, $ usemail, $ useweb, $ useni, $ useoicq, $ useaddr, $ useqm );
Break;
Case ($ reginfo = 2 ):
Usemess ("error! The password is too long ", $ usename, $ usemail, $ useweb, $ useni, $ useoicq, $ useaddr, $ useqm );
Break;
Case ($ reginfo = 3 ):
Usemess ("error! Invalid oicq number ", $ usename, $ usemail, $ useweb, $ useni, $ useoicq, $ useaddr, $ useqm );
Break;
Case ($ reginfo = 4 ):
Usemess ("error! The user password contains invalid characters ", $ usename, $ usemail, $ useweb, $ useni, $ useoicq, $ useaddr, $ useqm );
Break;
Case ($ reginfo = 5 ):
Usemess ("error! The username contains invalid characters ", $ usename, $ usemail, $ useweb, $ useni, $ useoicq, $ useaddr, $ useqm );
Break;
Case ($ reginfo = 6 ):
Usemess ("error! Invalid OICQ number ", $ usename, $ usemail, $ useweb, $ useni, $ useoicq, $ useaddr, $ useqm );
Break;
Case ($ reginfo = 7 ):
Usemess ("error! Invalid EMAIL address ", $ usename, $ usemail, $ useweb, $ useni, $ useoicq, $ useaddr, $ useqm );
Break;
Case ($ reginfo = 8 ):
Usemess ("Sorry! This user already exists. Please reselect ", $ 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 ("database writing error, please contact <font color = 'ffffff'> dark intermediary </font>", $ usename, $ usemail, $ useweb, $ useni, $ useoicq, $ useaddr, $ useqm );
Break;
Default:
$ Reginfo = update ($ reginfo );
Regok ("registration successful, the following is your personal information", $ reginfo );
Break;
}
}
Else usemess ("Please fill in your information", 'mandatory ', 'required ', 'required ');
}
If ($ action = dl) // login function
{
If ($ uname)
{
$ Query = "select usepass, usename, enddate, useni from useinfo where usename = '". $ uname. "'"; // check whether a user exists
$ Req = @ mysql_query ($ query );
If ($ req)
{
$ User = @ mysql_fetch_array ($ req );
If ($ user [0] ==$ upass) // check whether the password is correct
{
$ Time = date (Y, n, month, j, G, I );
$ Query = "update useinfo set enddate = '$ time' where usename ='". $ uname ."'";
$ Req = @ mysql_query ($ query );
If ($ req) dlokey ($ user );
Else dlmes ("Data logon error! ");
}
Else dlmes ("the user password is incorrect. Please verify it! ");
}
Else dlmes ("user information cannot be found. Please confirm! If not, click <a href = 'reguse. php? Action = xy'> here </a> ");
}
Else dlmes ("User Logon ");
}
?>
</Body>
</Html>

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.