note 37861 modified in function.defined by danbrown
| From: | danbrown@php.net | Date: | Fri, 30 Jan 2009 21:36:02 +0000 |
| Subject: | note 37861 modified in function.defined by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-150018@lists.php.net to get a copy of this message | ||
This can be useful if you want to protect pages which get included from outsiders eyes, on your mail
page (the page viewable by people) put define("X", null); then on all your other pages,
you can then do something like:
<?php
if (!defined("X")) {
echo "You Cannot Access This Script Directly, Have a Nice Day.";
exit();
}
?>
And your page is a good as protected :)
--was--
This can be useful if you want to protect pages which get included from outsiders eyes, on your mail
page (the page viewable by people) put define("X", null); then on all your other pages,
you can then do something like:
if (!defined("X")) {
echo "You Cannot Access This Script Directly, Have a Nice Day.";
exit();
}
And your page is a good as protected :)
http://php.net/manual/en/function.defined.php