New Upload >>

Recent Uploads:

GQVrajgIJGTdBqCtR..
about 20 hours ago
sf_latest_posts_t..
1 day ago
GonaeDqClNBJbLkaE..
1 day ago
Simple Qsort
1 day ago
Simple Merge_Sort
1 day ago
sTZXtLUHhTFz
1 day ago
IVhFLiVidsOJWBlSm
1 day ago
cSeMGAyAzD
1 day ago
tumblr theme by s..
1 day ago
lgWkxiZEavpaFY
about 2 days ago

Pastebin Archive


Bookmark and Share




Untitled

Posted on October 2, 2009, 1:46 am UTC anonymously (11 months ago)

Code (highlighted for PHP)
  1. <?
  2. $url = urlencode(htmlentities($_GET[\'url\'], ENT_NOQUOTES));
  3. if(isset($url)){
  4.         $source = file_get_contents($url);
  5.         $source = htmlspecialchars($source);
  6.         $uhoh[0] = \'/<?/\';
  7.         $uhoh[1] = \'/<%/\';
  8.         $uhoh[2] = \'/?>/\';
  9.         $uhoh[3] = \'/%>/\';
  10.         $phew[0] = \'&lt;?\';
  11.         $phew[1] = \'&lt;%\';
  12.         $phew[2] = \'?&gt;\';
  13.         $phew[3] = \'%&gt;\';
  14.         $source = preg_replace($uhoh, $phew, $source);
  15. }
  16. ?>
  17.  
  18. <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
  19. <html>
  20.  
  21. <head>
  22.         <title> <?if(isset($url)){echo \'View page source of \'.urldecode($url);}else{echo\'View source of remote files\';}?></title>
  23. </head>
  24.  
  25. <body>
  26.  
  27. <?php
  28. if(!isset($url)){
  29.         echo \'<form action=\"\'.$PHP_SELF.\'\" method=\"get\">
  30.                         <p>
  31.                         <input type=\"text\" name=\"url\" value=\"http://yoururlhere/file.htm\" />
  32.                         </p>
  33.                   </form>\';
  34. }
  35. else{
  36.         echo $source;
  37. }
  38. ?>
  39.  
  40. </body>
  41. </html>