note 68714 deleted from function.include by peehaa
| From: | peehaa@php.net | Date: | Fri, 09 Dec 2016 22:46:48 +0000 |
| Subject: | note 68714 deleted from function.include by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208383@lists.php.net to get a copy of this message | ||
Note Submitter: mlindal at pfc dot forestry dot ca
----
If a person directly accesses an include file by mistake, you may want to forward them to a correct
default page.
Do this by:
Say the file to be included is 'newpubs.php'
and the main pages are either newpubs_e.php or newpubs_f.php
<?php
if($_SERVER[PHP_SELF]=="/newpubs.php")
{
header("Location: newpubs_e.php");
exit;
}
?>
Will send them to newpubs_e.php if they try to access newpubs.php directly.