note 52111 added to function.include
| From: | richard at opnetworks dot com | Date: | Thu, 21 Apr 2005 12:09:24 +0000 |
| Subject: | note 52111 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88345@lists.php.net to get a copy of this message | ||
$path_parts = parse_url($_SERVER['REQUEST_URI']);
if($path_parts['path'] == "/dir/path")
{
echo "Access Denied";
exit();
}
I use this as a good practice. To keep people from directly running a include script
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52111
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52111&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52111&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52111&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52111&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52111&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52111&report=yes
Search -- http://master.php.net/manage/user-notes.php