View file wapirate/A1/source.php

File size: 6.23Kb
<?php





include("core.php");

include("config.php");





header("Content-type: text/html; charset=ISO-8859-1");

echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";

echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";

echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";







$bcon = connectdb();

if (!$bcon)

{

    echo "<head>";

    echo "<title>Error!!!</title>";

    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";

    echo "</head>";

    echo "<body>";

    echo "<div><br/>Doh!<br/></div>";   

    echo "<p align=\"center\">";

    echo "<img src=\"images/exit.gif\" alt=\"*\"/><br/>";

    echo "ERROR! cannot connect to database<br/><br/>";

    echo "This error usually happens when backing up the database, please be patient, The site will be up as soon as possible<br/><br/>";

    echo "You can temporary use our other <a href=\"http://wapirate.madpage.com/chat/index.php\">chatroom</a> while wapirate is offline<br/>";

    echo "<b>THANK YOU VERY MUCH</b>";

    echo "</p>";

    echo "<div>$addy</div>";

    echo "</body>";

    echo "</html>";

    exit();

}

$brws = explode(" ",$HTTP_USER_AGENT);

$ubr = $brws[0];

$uip = getip();

$action = $_GET["action"];

$sid = $_GET["sid"];

$page = $_GET["page"];

$who = $_GET["who"];

$wnick = getnick_uid($who);

$uid = getuid_sid($sid);

$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));

cleardata();

if(isipbanned($uip,$ubr))

    {

      if(!isshield(getuid_sid($sid)))

      {

      echo "<head>";

    echo "<title>Error!!!</title>";

    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";

    echo "</head>";

    echo "<body>";

    echo "<div><br/>Doh!<br/></div>";        

      echo "<p align=\"center\">";

      echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";

      echo "This IP address is blocked<br/>";

      echo "<br/>";

      echo "However we grant a shield against IP-Ban for our best users, you can try to see if you are shielded by trying to login, if you keep coming to this page that means you are not shielded, so come back when the ip-ban period is over<br/><br/>";

      $banto = mysql_fetch_array(mysql_query("SELECT  timeto FROM ibwf_penalties WHERE  penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 "));

      //echo mysql_error();

      $remain =  $banto[0] - time();

      $rmsg = gettimemsg($remain);

      echo " IP: $rmsg<br/><br/>";

      

      echo "</p>";

      echo "<p>";

  echo "<form action=\"login.php\" method=\"get\">";

  echo "username:<br/> <input name=\"loguid\" format=\"*x\" size=\"8\" maxlength=\"30\"/><br/>";

  echo "password:<br/> <input type=\"password\" name=\"logpwd\" size=\"8\" maxlength=\"30\"/><br/>";

echo "<input type=\"submit\" value=\"login &#187;\"/>";

echo "</form>"; 

  echo "</p>";

    echo "<div>$addy</div>";

    echo "</body>";

    echo "</html>";

    exit();

      }

    }



//echo isbanned($uid);

if(isbanned($uid))

    {

     echo "<head>";

    echo "<title>Error!!!</title>";

    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";

    echo "</head>";

    echo "<body>";

    echo "<div><br/>Doh!<br/></div>";         

      echo "<p align=\"center\">";

      echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";

      echo "You are <b>Banned</b><br/>";

      $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));

	  $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));

	  

   $remain = $banto[0]- time();

   $rmsg = gettimemsg($remain);

   echo "Time to finish your penalty: $rmsg<br/><br/>";

   echo "Ban Reason: $banres[0]";

   echo "</p>";

    echo "<div>$addy</div>";

    echo "</body>";

    echo "</html>";

    exit();

}

$res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");



////////////////////////////////////////MAIN PAGE



$url = $_GET['url'];

if($action=="main")

{

addonline(getuid_sid($sid),"Source Viewing!","");

  echo "<head>";

  echo "<title>wapirate</title>";

  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

  echo "</head>";

  echo "<body>";  

  echo "<div><br/>Source Viewer<br/></div>";

if ($url == "")

{

echo "<p align=\"center\">";

echo "<b><small>Enter Url:</small></b><br/>";

echo "<small>(include http://)</small><br/>";

echo "</p><form action=\"source.php?action=main&amp;url=result&amp;sid=$sid\" method=\"post\">";

echo "<input type=\"text\" name=\"address\" maxlength=\"999\" emptyok=\"true\" value=\"\"/><br/><br/>";

echo "<input type=\"submit\" value=\"Get Source\"/>";

echo "</form><p align=\"center\">";

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&amp;sid=$sid\">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&amp;sid=$sid\">Back</a></small></b><br/>";

echo "</p>";

}

}

echo "<p align=\"center\">";

echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a><br/><br/>";

echo "<small>";

echo "© wapirate - ".date(Y);

echo "</small>";

echo "</p>\n";

    echo "<div>$addy</div>";

    echo "</body>";

    echo "</html>";

    exit();

}













	echo "</html>";

?>