note 55990 added to function.include
| From: | mat at osu1 dot php dot net | Date: | Fri, 19 Aug 2005 21:10:47 +0000 |
| Subject: | note 55990 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93928@lists.php.net to get a copy of this message | ||
If you want to tell people not to look at your source code in a more creative way than just setting
your .htaccess correctly in the includes folder, you can just put something like this at the start
of the included files.
<?php
if( __FILE__ === $_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF'] ){
echo '<html><head><title>Go away.</title></head>';
echo '<body><h1>Go away.</h1>';
echo '<p>Stop looking at my source code.</p></body></html>';
exit;
}
?>
I'd rather this than define something every page I include something on. Just personal taste.
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55990
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55990&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55990&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55990&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55990&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55990&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55990&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55990&report=yes
Search -- http://master.php.net/manage/user-notes.php