<?php 
header("Content-type: text/html; charset=utf-8");
//公共函数库
 
//弹窗提示错误函数
//用法$_info为参数  _alert_back('验证码不正确');
//alert('". $_info ."')是弹出窗口提示
function _alert_back($_info){
	echo "<script type='text/javascript'>alert('". $_info ."');history.back();</script>";
	exit();
}

//弹窗提示确定后自动跳转 
//用法 _location('成功登陆','index.php');
function _location($_info,$_url){
	echo "<script type='text/javascript'>alert('". $_info ."');location.href='$_url';</script>";
	exit();
}
//自动跳转
//用法_alert_back_jump('P_login.php');
function _alert_back_jump($_url){
	echo "<script type='text/javascript'>location.href='$_url';</script >";
	exit();
}




//管理员登录状态的判断
function _Alogin_state(){
	if(isset($_COOKIE['Aname'])){
		_alert_back_jump('?Admin=index');
	}
}

//清楚session
//function _session_destroy(){
//	session_destroy();
//}

//退出后台登陆-删除COOKIE 用户名值为空而且时间设为过去
//直接点击退出按钮，在链接页面加入 _unsetcookies(); 即可
function _Ansetcookies(){
	setcookie('Aname',"",time()-1);	
	session_destroy();//执行以下session
	_location('成功注销','/adminym288.php');
}
//后台目录名称


?>