Source code 7 of my forum

Source: Internet
Author: User
: My Forum Source Code 7: info. inc. php mainly makes some judgments and information processing. & lt ;? Phpfunctionupdate ($ reginfo) {switch ($ reginfo [4]) {case ($ reginfo [4] 1): $ reginfo [4] Male; break; default: $ reginfo [4] female; info. inc. php mainly performs judgment and information processing.
Function update ($ reginfo)
{
Switch ($ reginfo [4])
{
Case ($ reginfo [4] = 1 ):
$ Reginfo [4] = "male ";
Break;
Default:
$ Reginfo [4] = "female ";
Break;
}
Switch ($ reginfo [11])
{
Case ($ reginfo [11] = 1 ):
$ Reginfo [11] = "member ";
Break;
Case ($ reginfo [11] = 2 ):
$ Reginfo [11] = "moderator ";
Break;
Case ($ reginfo [11] = 3 ):
$ Reginfo [11] = "administrator ";
Break;
Case ($ reginfo [11] = 4 ):
$ Reginfo [11] = "webmaster ";
Break;
Default:
$ Reginfo [11] = "tourists ";
Break;
}
Switch ($ reginfo [6])
{
Case ($ reginfo [6] = 5 ):
$ Reginfo [6] = "I am a student ";
Break;
Case ($ reginfo [6] = 1 ):
$ Reginfo [6] = "civil servant ";
Break;
Case ($ reginfo [6] = 2 ):
$ Reginfo [6] = "company employee ";
Break;
Case ($ reginfo [6] = 3 ):
$ Reginfo [6] = "freelancer ";
Break;
Case ($ reginfo [6] = 4 ):
$ Reginfo [6] = "idle ";
Break;
Default:
$ Reginfo [6] = "don't tell you ";
Break;
}
If ($ reginfo [12] = 1) $ reginfo [12] = "yes ";
Else $ reginfo [12] = "no ";
If ($ reginfo [18] = 1) $ reginfo [18] = "yes ";
Else $ reginfo [18] = "no ";
If ($ reginfo [12] = 2)
{$ Reginfo [4] = $ reginfo [4]. "[confidential]";
$ Reginfo [5] = $ reginfo [5]. "[confidential]";
$ Reginfo [6] = $ reginfo [6]. "[confidential]";
$ Reginfo [7] = $ reginfo [7]. "[confidential]";
$ Reginfo [8] = $ reginfo [8]. "[confidential]";
Return $ reginfo;
}
Else
Return $ reginfo;
}
Function uinfo ($ useinfo, $ t)
{
If ($ t = name) return eregi ("^ [a-zA-Z0-9] [_-~ A-zA-Z0-9] {} $ ", $ useinfo); // judge the user name
Else if ($ t = oicq) return eregi ("^ [0-9] {1, 10} $", $ useinfo); // oicq
Else if ($ t = pass) return eregi ("^ [a-zA-Z0-9] {1, 8} $", $ useinfo); // pass
Else if ($ t = web) // web
{
$ N = strstr ($ useinfo ,'.');
If ($ n & strlen ($ useinfo)> 10)
{
$ X [1] = substr ($ n, 0, 1 );
$ N = strstr (substr ($ n, 1 ),'.');
$ X [2] = substr ($ n, 0, 1 );
If ($ x [1] === x [2]) return OK;
}
}
Else return eregi ("^ [_. 0-9a-z-] + @ ([0-9a-z] [0-9a-z-] + .) + [a-z] {2, 3} $ ", $ useinfo); // email
}
Function err ($ mess)
{
Echo"

". $ Mess ."


";Echo"";Echo"
";
}
Function cuser ($ cookiem, $ action)
{
If ($ cookiem) // check whether this user exists
{
$ Useinfo = $ cookiem; // enable COOKIE
$ Query = "select * from useinfo where usename = '". $ useinfo ."'";
$ Req = mysql_query ($ query );
If ($ req)
{
$ User = mysql_fetch_array ($ req );
If ($ useinfo = $ user [0])
{
$ Useinfo = $ user;
Return $ useinfo;
}
Else
{
$ Useinfo [0] = "";
$ Useinfo [2] = "tourists ";
Return $ useinfo;
}
}
Else
{
$ Useinfo [0] = "";
$ Useinfo [2] = "tourists ";
Return $ useinfo;
}
}
Else if ($ action) // if not, check whether information is passed in.
{
$ User = $ action;
$ Query = "select * from useinfo where usename = '". $ user ."'";
$ Req = mysql_query ($ query );
If ($ req)
{
$ User = mysql_fetch_array ($ req); // locate
If ($ user [0] = $ useinfo)
{
$ Useinfo = $ user;
Return $ useinfo;
}
Else
{
$ Useinfo [0] = "";
$ Useinfo [2] = "tourists ";
Return $ useinfo;
}
}
Else
{
$ Useinfo [0] = "";
$ Useinfo [2] = "tourists ";
Return $ useinfo;
}
}
Else
{
$ Useinfo [0] = "";
$ Useinfo [2] = "tourists ";
Return $ useinfo;
} // None
}
Function err_info ($ mess)
{
Echo"

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.