<span class="unnamed3">info.inc.php主要做些判断和信息处理 <br><br><?php <br/>function update($reginfo) <br>{ <br> switch ($reginfo[4]) <br> { <br> case ($reginfo[4]==1): <br> $reginfo[4]="男"; <br> break; <br> default: <br> $reginfo[4]="女"; <br> break; <br> } <br><br> switch ($reginfo[11]) <br> { <br> case ($reginfo[11]==1): <br> $reginfo[11]="会员"; <br> break; <br> case ($reginfo[11]==2): <br> $reginfo[11]="版主"; <br> break; <br> case ($reginfo[11]==3): <br> $reginfo[11]="管理员"; <br> break; <br> case ($reginfo[11]==4): <br> $reginfo[11]="站长"; <br> break; <br> default: <br> $reginfo[11]="游客"; <br> break; <br> } <br> switch ($reginfo[6]) <br> { <br> case ($reginfo[6]==5): <br> $reginfo[6]="我是学生"; <br> break; <br> case ($reginfo[6]==1): <br> $reginfo[6]="公务员"; <br> break; <br> case ($reginfo[6]==2): <br> $reginfo[6]="公司雇员"; <br> break; <br> case ($reginfo[6]==3): <br> $reginfo[6]="自由职业"; <br> break; <br> case ($reginfo[6]==4): <br> $reginfo[6]="无所事事"; <br> break; <br> default: <br> $reginfo[6]="不告诉你"; <br> break; <br> } <br> if ($reginfo[12]==1) $reginfo[12]="是"; <br> else $reginfo[12]=="否"; <br> if ($reginfo[18]==1) $reginfo[18]="是"; <br> else $reginfo[18]="否"; <br>if ($reginfo[12]==2) <br>{$reginfo[4]=$reginfo[4]." [保密]"; <br> $reginfo[5]=$reginfo[5]." [保密]"; <br> $reginfo[6]=$reginfo[6]." [保密]"; <br> $reginfo[7]=$reginfo[7]." [保密]"; <br> $reginfo[8]=$reginfo[8]." [保密]"; <br> return $reginfo; <br>} <br>else <br> return $reginfo; <br>} <br>function uinfo($useinfo,$t) <br>{ <br> if ($t==name) return eregi("^[a-zA-Z0-9][_-~a-zA-Z0-9]{2,8}$",$useinfo); //判断用户名 <br> else if($t==oicq) return eregi("^[0-9]{1,10}$",$useinfo); //oicq <br> else if($t==pass) return eregi("^[a-zA-Z0-9]{1,8}$",$useinfo); //pass <br> else if($t==web) //web <br> { <br> $n=strstr($useinfo,'.'); <br> if ($n&&strlen($useinfo)>10) <br> { <br> $x[1]=substr($n,0,1); <br> $n=strstr(substr($n,1),'.'); <br> $x[2]=substr($n,0,1); <br> if ($x[1]==$x[2]) return OK; <br> } <br> } <br> else return eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$useinfo); //邮箱 <br><br>} <br><br>function err($mess) <br>{ <br>echo "<table width="100%" border="0" cellspacing="0" cellpadding="0">"; <br>echo "<div align="center"><font color="ff0000">".$mess."</font></div>"; <br>echo "</table>"; <br>} <br><br>function cuser($cookiem,$action) <br>{ <br>if ($cookiem) //检查是否有此用户 <br> { <br> $useinfo=$cookiem; //打开COOKIE <br> $query="select * from useinfo where usename='".$useinfo."'"; <br> $req=mysql_query($query); <br> if ($req) <br> { <br> $user=mysql_fetch_array($req); <br> if ($useinfo==$user[0]) <br> { <br> $useinfo=$user; <br> return $useinfo; <br> } <br> else <br> { <br> $useinfo[0]=""; <br> $useinfo[2]="游客"; <br> return $useinfo; <br> } <br><br> } <br> else <br> { <br> $useinfo[0]=""; <br> $useinfo[2]="游客"; <br> return $useinfo; <br> } <br> } <br>else if($action) //如果不是,则看是否有信息传入 <br> { <br> $user=$action; <br> $query="select * from useinfo where usename='".$user."'"; <br> $req=mysql_query($query); <br> if ($req) <br> { <br> $user=mysql_fetch_array($req); //找到 <br> if ($user[0]==$useinfo) <br> { <br> $useinfo==$user; <br> return $useinfo; <br> } <br> else <br> { <br> $useinfo[0]=""; <br> $useinfo[2]="游客"; <br> return $useinfo; <br> } <br> } <br> else <br> { <br> $useinfo[0]=""; <br> $useinfo[2]="游客"; <br> return $useinfo; <br> } <br> } <br><br>else <br> { <br> $useinfo[0]=""; <br> $useinfo[2]="游客"; <br> return $useinfo; <br> } //都没有 <br>} <br><br><br><br>function err_info($mess) <br>{ <br>echo "<script language="JavaScript"> alert('".$mess."'); </script>"; <br>} <br>?> </span> <p style="width:100%;text-align:center;margin:10px 0"> <br> <br> </p> <p style="width:100%;text-align:center;margin:10px 0"> </p> <p class="clear"></p>