So I made a custom page handler to make my code much cleaner. I have it running on multiple websites but on the website I am working right now it doesn't work.
This is the code:
<?php
$page = $_GET["p"];
include_once("pages/" . $page . ".php");
if($page == "") {
header("Location: index.php?p=index");
}
?>
and this is the error: Warning: include_once(): Failed opening 'pages/.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/ubuntu/workspace/admin_panel/page-handler.php on line 3
Warning: Cannot modify header information - headers already sent by (output started at /home/ubuntu/workspace/admin_panel/header.php:474) in /home/ubuntu/workspace/admin_panel/page-handler.php on line 5
It works on all of the other websites I have it running on.
Does someone know why it isn't working? Thanks.