My forum source code seven

WBOY
Release: 2016-07-29 08:33:52
Original
1003 people have browsed it

info.inc.php mainly does some judgment and information processing
function update($reginfo)
{
       switch ($reginfo[4])
                                                                                                                      F $ reginfo [4] = "Male";
Break;
default:
$ reginfo [4] = "female";
break;
}
switch ($ reginfo [11])
{
case ($ reginfo [ 11]==1):
                   $reginfo[11]="Member";                    break; case ($reginfo[11]==3):
$reginfo[11]="Administrator";
break; case ($reginfo[11]==4):
$reginfo[11]="Webmaster ";
                                                                                                                                                                                         case ($reginfo[6]==5):
          $ reginfo[6]="I am a student";
                                                                                               ‐                                           reginfo                                                                           reginfo [6]    =2):
                 $reginfo[6]="Company employee"; $reginfo[6]==4):
                                                                           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]{2,8}$",$useinfo); //Judgement Username
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);  //邮箱
}
function err($mess)
{
echo "

";
echo "
".$mess."
";
echo "
";
}
function cuser($cookiem,$action)
{
if ($cookiem)                        //检查是否有此用户
   {
       $useinfo=$cookiem;  //打开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]="游客";
             return $useinfo;
                }
       }
       else
       {
          $useinfo[0]="";
          $useinfo[2]="游客";
          return $useinfo;
       }
   }
else if($action)         //如果不是,则看是否有信息传入
   {
       $user=$action;
       $query="select * from useinfo where usename='".$user."'";
       $req=mysql_query($query);
       if ($req)
       {
           $user=mysql_fetch_array($req);   //找到
           if ($user[0]==$useinfo)
              {
                 $useinfo==$user;
                 return $useinfo;
              }
           else
              {
                 $useinfo[0]="";
                 $useinfo[2]="游客";
                 return $useinfo;
              }
       }
       else
       {
         $useinfo[0]="";
         $useinfo[2]="游客";
         return $useinfo;
       }
   }
else
    {
      $useinfo[0]="";
      $useinfo[2]="游客";
      return $useinfo;
    }//None
}
function err_info($mess)
{
echo "";
}
?>

The above has introduced the source code of my forum seven, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!