Okay so I have a simple script that is supposed to route traffic on my site however, I am have a hard time figuring out how to fix the "Undefined Index Error" that appears at the top of the page when ever I use the 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');
}
?>
What am I doing wrong in regards towards this? Now the question was flagged, but I simply trying to redirect users to the home page even if they just type localhost/site name. And I still get the following error: Notice: Undefined index: p in C:\xampp\htdocs\BayingHound\index.php on line 3