Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am going to assume that you are properly routing the 404s to this file. What is happening is that because the 404 doesn't have a $_GET['page'] your code is setting itself to be home and loading the home page.</p> <p>Assuming this is the index.php file I would add a conditional to check for this and change the default to a case 404. This is the new code in full.</p> <pre><code>&lt;?php //begin the webpage //index page selector placed into an array for options for the user to select //session started recording attributes session_start(); error_reporting(0); //including other view class and model class function to be used on this page include 'views/viewClass.php'; include 'classes/modelClass.php'; class PageSelector { public function run() { //Check to make sure they are loading a legit page first if($_SERVER['PHP_SELF'] != 'index.php'){ $_GET['page'] = '404'; } //has the user decided which page to go to? //if not then we will direct him to the homepage if(!$_GET['page']) { $_GET['page'] = 'Home'; } //extending a new model class $model = new Model; //get the page information $pageInfo = $model -&gt; getPageInfo($_GET['page']); //select which page to include when the user clicks //on either register/home/my account/my bids/my sell/completed auctions/edit etc..etc..etc.. switch($_GET['page']) { case 'Register': include 'views/register.php'; $view = new HomeView($pageInfo, $model); break; case 'Home': include 'views/homeView.php'; $view = new HomeView($pageInfo, $model); break; case 'My Account': include 'views/myaccount.php'; $view = new myaccount($pageInfo, $model); break; case 'My Bids': include 'views/mybids.php'; $view = new Mybids($pageInfo, $model); break; case 'My Sell': include 'views/mysell.php'; $view = new mysell($pageInfo, $model); break; case 'Completed Auctions': include 'views/checkout.php'; $view = new checkout($pageInfo, $model); break; case 'editProduct': include 'views/editProductView.php'; $view = new EditProductView($pageInfo, $model); break; case 'addProduct': include 'views/addProductView.php'; $view = new AddProductView($pageInfo, $model); break; case 'deleteProduct': include 'views/deleteProductView.php'; $view = new DeleteProductView($pageInfo, $model); break; case 'deleteUser': include 'views/deleteUserView.php'; $view = new DeleteUserView($pageInfo, $model); break; case 'search': include 'views/search.php'; $view = new search($pageInfo, $model); break; case 'product': include 'views/productView.php'; $view = new ProductView($pageInfo, $model); break; case '404': include 'views/404.php'; $view = new error($pageInfo,$model); break; } echo $view -&gt; displayPage(); } } $pageSelect = new PageSelector(); $pageSelect -&gt; run(); //calls the selector to run after user has selected. </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload