SitePoint thread

How to protect files from being accessed on your server:
	  Step One
	    1. open your FTP program
	    2. navigate to the path above your root directory
	    3. create a directory called "tpihfjp"  // this_path_is_hidden_from_Joe_Public
	    4. create and save this file:  "tpihfjp/hidden_test_file.php"...
	    5. ... with the following content
	            <?php echo 'This file is in your tpihfjp directory: '__FILE__; ?> 
	  Step Two
	    1. change line 2 in this scipt to $RUN_TEST = TRUE;
	    2. copy this script to "show_contents_of_hidden_path.php" file on your server 
	    3. run this script file on your server
	  Step Three
	    1. validate results and see if it is possible to access the "tpihfjp" path.
Source file: <?php 
FALSE// Change to TRUE to RUN TEST

error_reporting(10);    // E_ALL); // for debugging
ini_set('display_errors','On');  // 'On'); // for debugging
$title    'How to hide files on your server';

function run_test($RUN_TEST FALSE// must be FALSE on my server
    if (
$filename 'show_contents_of_hidden_path.php';
$document_root $_SERVER['DOCUMENT_ROOT'];
$len strlen($document_root); // 25
$pos strrpos($document_root"/"); // 24
$path_above_document_root substr($document_root0$pos);
$title 'Contents of your hidden path : <b>tpisfjp</b>';
$path  $path_above_document_root .'/tpihfjp/';
'<legend>' .$title .'</legend>';
$message '<br />No we have no hidden file : '// default
if (file_exists($path .$filename))        
$message 'YES we have hidden file : ';
$path 'show_contents_of_hidden_path.php');
'<h3>'$message .$path $filename  .'</h3>';   
//endif RUN_TEST

<!DOCTYPE html>
    <title><?php echo $title?></title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <link type='text/css' href='_style.css' rel='stylesheet' />
            <a href=''>SitePoint thread</a>
        <?php include '_instructions.php'?>
// show contents of this file
echo "<fieldset style='width:88%; min-width:420px; margin:2.2em auto'>";
'<legend>Source file:</legend>';
"<fieldset style='width:88%; min-width:420px; margin:2.2em auto'>";
        <?php /* simple page monitor access */ include '../_google_sitepoint.php';  ?>
_style.css: *              {color:#000}
body         {width:98%; min-width:600px; background:#fd0 none}

fieldset {width:88%; min-width:420px; margin:2.2em auto; 
                   background:#eee none; border:dotted 2px #090}
a:hover  {background:#930 none; color:#fff}

p        {text-align:center}