<!--======================================================================-->
<!-- Script to display the php code on browser without interpretation     -->
<!-- Must pass the name of script via  url?script=name                    -->
<!-- File is localized so script can only look into files in current dir  -->
<!--======================================================================-->

<?php

	$filename = $_GET['script'];			#get script name

	$path = explode("/", $filename);		#break up path into array

	$localdir  = $path[count($path)-2];		#take the relative directory name		
	$localfile = $path[count($path)-1];		#take the relative file name		
	$script    = $localdir . '/' . $localfile;	#append them with a /

	$input = fopen ($script, 'r')
                    or die ("Cannot open $script for read");

	$data = file($script)				#read entire file into array
                    or die ("Cannot read from $script");

	print "<pre>";

	foreach($data as $line)				#loop through the array
	{				
	    $line = str_replace("<", "<", $line);	#replace < with <	
            print $line;				#write the line
	}

	print "</pre>";

	fclose($input);

?>
</html>