faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 8 people (50%) answered Yes
Recently 4 of 8 people (50%) answered Yes

Entry

Block direct access

Dec 23rd, 2004 13:21
Matthew Wilkinson, Thomas Anderson,


if (eregi($pagename, $PHP_SELF)) {
  die ("You can't access this file directly...");
}
$pagename must be the name of the file, not the path.
eg. $pathname = "nodirectaccess.php";