添加管理员的错误。。。
<?php
require_once '../include.php';
$act=$_REQUEST['ast'];
if($act=="logout"){
logout();
}elseif($act=="addAdmin"){
$mes=addAdmin();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<?php
if($mes){
echo $mes;
}
?>
</table>
</form>
</body>
function logout(){
$_SESSION=array();
if(isset($_COOKIE[session_name()])){
setcookie(session_name(),"",time()-1);
}
if(isset($_COOKIE['adminId'])){
setcookie("adminId","",time()-1);
}
if(isset($_COOKIE['adminName'])){
setcookie("adminName","",time()-1);
}
session_destroy();
header("location:login.php");
}
function addAdmin(){
$arr=$_POST;
if(insert("imooc_admin",$arr)){
$mes="添加成功!<br/><a href='addAdmin.php'>继续添加</a>";
}else{
$mes="添加失败!<br/><a href='addAdmin.php'>重新添加</a>";
}
return $mes;
}