View file wapirate/wml/source.php

File size: 2.4Kb
<?php 
include("head.php"); 

////////////////////////////////////////MAIN PAGE 
$url = $_GET['url']; 
if($action=="main") 
{ 
addonline(getuid_sid($sid),"Source Viewing!",""); 
echo "<card id=\"source\" title=\"Source Viewer\">"; 
echo "<p align=\"center\">"; 
echo "<b>Source Viewer</b><br/>"; 
echo "</p>"; 

if ($url == "") 
{ 
echo "<p align=\"center\">"; 
echo "<b><small>Enter Url:</small></b><br/>"; 
echo "<small>(include http://)</small><br/>"; 
echo "<input type=\"text\" name=\"address\" maxlength=\"999\" emptyok=\"true\" value=\"\"/>"; 
echo "<br/>"; 
echo "<small>"; 
echo "<anchor>Get Source"; 
echo "<go href=\"source.php?action=main&amp;url=result\" method=\"post\">"; 
echo "<postfield name=\"address\" value=\"$(address)\"/>"; 
echo "</go>"; 
echo "</anchor>"; 
echo "<br/>---<br/>"; 
echo "</small>"; 
echo "</p>"; 
} 

if ($url == "result") 
{ 
echo "<p align=\"center\">"; 
$address = $_POST['address']; 
echo "<small>Source results for:</small>"; 
echo "<br/><b><small><a href=\"$address\">$address</a></small></b><br/>"; 
echo "<br/>"; 
echo "</p>"; 


$source = @htmlspecialchars(file_get_contents($address)); 

if (!$source) 
{ 
echo "<p align=\"center\">"; 
echo "<small><b>there seems to be a problem with the url you added!!!</b></small><br/>"; 
echo "<small>Source results FAILED for:<br/><b>$address</b></small>"; 
echo "<br/><b><small><a href=\"source.php?action=main\">Back</a></small></b><br/>"; 
echo "</p>"; 
} 
if (ereg("http://",$address)) 
{ 
echo "<p align=\"left\">"; 
echo "$source"; 
echo "</p>"; 
echo "<p align=\"center\">"; 
echo "<br/><b><small><a href=\"source.php?action=main\">Back</a></small></b><br/>"; 
echo "</p>"; 
} 
} 
echo "<p align=\"center\">"; 
echo "<a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a><br/><br/>"; 
echo "<small>"; 
echo "© wapirate - ".date(Y); 
echo "</small>"; 
echo "</p>\n"; 
echo "</card>\n"; 
} 
///////////////////////////////end 
else{ 
addonline(getuid_sid($sid),"Lost in Souce Viewer",""); 
echo "<card id=\"main\" title=\"$sitename\">"; 
echo "<p align=\"center\">"; 
echo "I don't know how you got into here, but there's nothing to show<br/><br/>"; 
echo "<img src=\"/images/line.gif\" alt=\"line\"/>"; 
echo "<br/><a href=\"index.php?action=main\">Home</a>"; 
echo "<br/><br/><small>&#169; $sitename</small>"; 
echo "</p></card>"; 
} 

?> 
</wml>