0
家伙即时寻找一个全面的代码检查,如果访客是的index.php然后显示一些行他检查用户的当前页面和条件语句
我的意思是我要考虑这个代码
各种可能性function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
$curentUrl = curPageURL();
if (preg_match("/index.php/",$curentUrl) || preg_match("/index.html/",$curentUrl)) {
}
但即时寻找一个更完整的代码,看看用户是
更完整?你目前的这个看起来有点过分。 – 2010-08-22 07:07:24
为什么不把代码放在index.php中,并确保用户在其中? – 2010-08-22 07:08:11
@Haim一些网站有多个文件。并使用include。去搞清楚。 – 2010-08-22 07:12:09