Jump to content

How to set a Page Default PHP


commonorx

Recommended Posts

NOT THIS: if side.html is not in existance

<?php

include ("side.html");

?>

 

But if for example:

 

index.php?c=4

 

Page 4 does not exist, but instead of some error showing up on the page, it just automatically goes to a default page.

It looks like rab answered it no?

NOT THIS: if side.html is not in existance

<?php

include ("side.html");

?>

 

But if for example:

 

index.php?c=4

 

Page 4 does not exist, but instead of some error showing up on the page, it just automatically goes to a default page.

It looks like rab answered it no?

 

I am confused, type properly and tell us the problem in a more understandable human readable format.

 

 

edit:

 


<?php

$page = $_GET['c'];


switch($page){


case '1':

// Do something

break;


case '4':


// Do something

break;


case '5':

// Do something


break;

case '8':

// Do something


break;

default:

header("LOCATION: default.html"); // Page to redirect the user to, if the page does not exists.

}




?>


Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.