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?

Link to comment
Share on other sites

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.

}




?>


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.