I have a script that when run from my browser will list the full contents of the directory of that folder for the user to look at and download. this is done by access a php script file which opens up into a frame window in the web browser.
What I want to do it stop people from accessing the script directly, so if they went to for example
www.mysite.com/files/list.php
they would get a full listing of the itmes in the folder files
I only want them to be able to access this from a direct link from my main page.
I have seen a script see below, which is ran on my forum, but am am not sure how to change it to the above
aNY help appreciated.
//////////////////////////////////
if (!eregi("modules.php",$_SERVER['PHP_SELF']))
{
die("You can not access this file directly..");
}
if(!isset($mainfile)){ include("mainfile.php");}
$index=0;
include("header.php");
OpenTable();
/////////////////////////////////
this script when put on my forum stops people linking direclty to it. how do I make it so that people can not link directly to my list.php script
thanks