|
1 <?php
2 // showphp.php
3 //
4 // Copyright <c> 1999 The Central Ohio Linux User Group.
5 // All rights reserved.
6 // Released under the GPL, v. 2. See: LICENSE.TXT
7 $title = "PHP source display page";
8 include("header.php");
9 ## we came from $HTTP_REFERER -- parse IT to determine what to show
10 ## template to parse out a POST string, and re-submit URI
11 /* <!--
12 Example:
13 $url=parse_url(http://www.php.net/download-php.php?csel=br);
14 $url[scheme] = http
15 $url[host] = www.php.net
16 $url[path] = /download-php.php
17 $url[query] = csel=br
18 --> */
19 $HTTP_REFERER = $_SERVER[HTTP_REFERER];
20 echo "The source of <a href=\"$HTTP_REFERER\">\n";
21 echo "$HTTP_REFERER</a>\n is as follows:<br>\n";
22 echo "<hr><br>\n";
23 $url=parse_url("$HTTP_REFERER");
24 $whereami=$url[path];
25 $basename = exec("basename $whereami");
26 ## $lookID = $url[query];
27 $REFERRER=exec("basename $whereami .php");
28 ## echo "2 $REFERRER<br>\n";
29 $SMURF = exec(" ls -1 *.txt | grep $REFERRER ");
30 if ($SMURF != "")
31 { echo "<table bgcolor=\"#FFFFFF\"><tr><td><listing>\n\n";
32 ##
33 ## we do some escaping on the ampersand and ,lt. and .gt. codes
34 ##
35 ## system("nl $SMURF | sed 's/</\</g' | sed 's/>/\>/g' ");
36 ##
37 system("nl $SMURF | sed 's/\&/\&/g' | sed 's/</\</g' | sed 's/>/\>/g' ");
38 echo "\n</listing></td></tr></table>\n";
39 }
40 echo "<hr>\n";
41 include("footer.php");
42 ?>
|