note 68714 modified in function.include by danbrown
| From: | danbrown@php.net | Date: | Mon, 18 May 2009 01:03:06 +0000 |
| Subject: | note 68714 modified in function.include by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155474@lists.php.net to get a copy of this message | ||
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.
--was--
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
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.
http://php.net/manual/en/function.include.php