Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP动态包含问题“;未定义索引“;重定向用户时_Php_Html - Fatal编程技术网

PHP动态包含问题“;未定义索引“;重定向用户时

PHP动态包含问题“;未定义索引“;重定向用户时,php,html,Php,Html,好的,我有一个简单的脚本,应该在我的网站上路由流量,但是,我很难找到如何修复当我使用URL“localhost/sitename/”时出现在页面顶部的“未定义索引错误” if(isset($_GET['p'])){ $notify = $_GET['p']; } if ($page == "home"){ include(__DIR__.'/_includes/pages/home.php'); } elseif($page == "maintenance") { include

好的,我有一个简单的脚本,应该在我的网站上路由流量,但是,我很难找到如何修复当我使用URL“localhost/sitename/”时出现在页面顶部的“未定义索引错误”
if(isset($_GET['p'])){ $notify = $_GET['p']; }
if ($page == "home"){
    include(__DIR__.'/_includes/pages/home.php');
} elseif($page == "maintenance") {
    include(__DIR__.'/_includes/pages/maintenance.php');
} else {
    include(__DIR__.'/_includes/pages/home.php');
}

?>

我在这方面做错了什么?现在问题被标记了,但我只是尝试将用户重定向到主页,即使他们只是键入localhost/site name。我仍然会遇到以下错误:注意:第3行的C:\xampp\htdocs\bayinghund\index.php中的未定义索引:p

虽然看起来是这样,但它不一定有助于解释我的问题。我知道这似乎是一个重复的问题,但我正试图解决这个问题。“未定义索引究竟是什么?”?在哪一条线上?用什么代码?@deceze注意:C:\xampp\htdocs\bayinghund\index.php中的未定义索引:p在第3行,上面代码的第一行触发了这个?对于给定的代码,这应该是不可能的。唯一的解释是,由于某些隐藏字符或其他原因,
'p'
不是
'p'