note 38081 added to function.show-source

From: Date: Sun, 07 Dec 2003 21:08:04 +0000
Subject: note 38081 added to function.show-source
Groups: php.notes 
Request: Send a blank email to php-notes+get-61604@lists.php.net to get a copy of this message
I wrote a function for viewing PHP source that only prints the source of files you specify. This way, if someone requests the source of a file that you didn't register, it will notify the user and withhold the source =). function SHOW_SOURCE () { global $_GET; $FILES = array ("file_1.php", "file_2.php"); $file = $_GET['file']; if ( ! in_array ($file, $FILES) ) { echo "<Strong>You Are Not Allowed To View The Source Of The Requested File!</strong>"; exit; } else { $the_source = show_source ( $file ); return $the_source; } } ?> I'm sure this could be expanded upon. ---- Manual Page -- http://www.php.net/manual/en/function.show-source.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38081 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38081&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38081&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#61604) next »