折雨的天空
php判定请求是否来自ajax
2013-10-9 我好笨


jquery的ajax







if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH'])==strtolower('XMLHttpRequest'))
{
//ajax请求,直接输出内容
exit($msg);
}
else
{
//普通请求
exit();
}



发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容