<?
Function adminlogin(){ //检测管理员是否登录
    global $tablepre;
	$AdminName=$_SESSION["admin_user"];
	$admin_pwd=$_SESSION["admin_pwd"];
    If ($AdminName!=""){
        $sql="select * from {$tablepre}ftbbs_admin where admin_user='".$AdminName."'";
        $rs=mysql_query($sql);
        $row = mysql_fetch_array($rs);
        $rsnum= mysql_num_rows($rs);
		if ($rsnum!=0){
		   $dbpwd=$row["admin_pwd"];
		   if ($dbpwd==$admin_pwd){
		      $adminlogin="Y";
		   }
		   else
		   {
		      $adminlogin="N";
		   }
		}
		else{
		   $adminlogin="N";
		  }
	  }
	 else{
	 $adminlogin="N";
	 }
	 return $adminlogin;
}
$adminlogin=adminlogin();
if ($adminlogin=="N"){
   echo "<br><br><br><br><center>非法登录或登录超时!</center>";
   exit;
}
?>