note 59523 deleted from function.highlight-file by nlopess

From: Date: Mon, 12 Dec 2005 20:22:14 +0000
Subject: note 59523 deleted from function.highlight-file by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-100029@lists.php.net to get a copy of this message
Note Submitter: trukin at gmail dot com ---- this function can be a high security risk. use something like in_array to check if a file is prohibited to be shown on screen. <? $ar= array('config.php', 'index.php', 'functions.php'); //array with files to denie $file = $_GET[file]; // iniziate the variable if(file_Exists($file)){ if(!in_array($file, $ar)){ // check if it is prohibited highlight_file($file); //highlight file }else{ // prohibited file echo "You do not have permision to see the ".$file." file."; } }else{ // file doesnt exist echo "That file does not exist."; } ?>

« previous php.notes (#100029) next »