Login.php

Started on the old forum in January 2008 · view the original in the archive · old links redirect here

4 replies · 1,044 views · started 18 years ago · 1 min read

2 participants
alexism Developer · 136 posts #1

i have delete half of the coding of my login.php which is in lavair html.here is the code :

<?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">";

echo "<head>";

echo "<title>$stitle</title>"; echo "<link rel="StyleSheet" type="text/css" href="style/style.css" />"; echo "</head>";

echo "<body>";

$bcon = connectdb(); if (!$bcon) {

echo " "; echo "<img src="images/exit.gif" alt="*"/> "; echo "ERROR! cannot connect to database

"; echo "This error happens usually when backing up the database, please be patient, The site will be up any minute

"; echo "Soon, we will offer services that doesn't depend on MySQL databse to let you enjoy our site, while the database is not connected "; echo "THANK YOU VERY MUCH"; echo " "; exit(); } $action = $_GET["action"]; $sid = $_GET["sid"]; $uid = getuid_sid($sid); if((islogged($sid)==false)||($uid==0)) {

echo " "; echo "You are not logged in "; echo "Or Your session has been expired

"; echo "<a href="index.php">Login</a>"; echo " "; exit(); } if(isbanned($uid)) {

echo " "; echo "<img src="images/notok.gif" alt="x"/> "; echo "You are Banned "; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM fun_penalties WHERE uid='".$uid."' AND penalty='1'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "Time to finish your penalty: $rmsg

"; //echo "<a href="index.php">Login</a>"; echo " "; exit(); }

some body help me to finish it with the original coding....thanks a lot...

andre3 Developer · 192 posts #2
<?php
/*
hehe
*/

header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo("<?xml version=\"1.0\"?>");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
include("config.php");

include("core.php");
connectdb();
$bcon = connectdb();
if (!$bcon)
{
    echo "<card id=\"main\" title=\"JamPLACE (ERROR!)\">";
    echo "<p align=\"center\">";
    echo "<img src=\"images/logo.gif\" alt=\"*\"/>
";
    echo "Database maintainace

";
    echo "Everyone Please go to the demo chatroom!!

";

    echo "Demo Chat:
";
echo "<a href=\"http://chat.waprank.mobi\">JamPLACE chat</a>";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    exit();
}
$uid = $_GET["loguid"];
$pwd = $_GET["logpwd"];

$tolog = false;
 echo "<card id=\"main\" title=\"$uid-JamPLACE\">";
  echo "<p align=\"center\">[size="1"]";
 
  
  $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 So Please Register again Thank u!<a href=\"register.php\">Register</a>

";
  }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

";
    }else{
      $tm = time();
      $xtm = $tm + (getsxtm()*60);
      $did = $uid.$tm;
      $res = mysql_query("INSERT INTO ibwf_ses SET id='".md5($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");
      
      if($res)
      {
        $tolog=true;
      

 

        echo "<img src=\"images/ok.gif\" alt=\"+\"/>Save this page $uid!
";
echo "<img src=\"images/getin.gif\" alt=\"*\"/>
";
        $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."'");
      }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."' WHERE uid='".getuid_nick($uid)."'");
          
          if($res)
          {
            $tolog=true;
            echo "<img src=\"images/ok.gif\" alt=\"+\"/>Logged in successfully as $uid
";
            

           
            
          }else{
            echo "<img src=\"images/point.gif\" alt=\"!\"/>Can't login at the time, plz try later
"; //no chance this could happen unless there's error in mysql connection
            
          }
          
        }
        
      }
          }
  }
  
  if($tolog)
{
  $sid = md5($did);
   
  
echo "<a href=\"index.php?action=main&sid=$sid\">";
echo "[enter main]</a>
";

echo "
Or:<a href=\"index.php?action=chat&sid=$sid\">Join Chat</a>
";

echo "Please Bookmark this Page for auto Login
";  
echo "
";

  
     

}else{
echo "<a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
}
echo "[/size]</p>";
  echo "</card>";

?>
</wml>
alexism Developer · 136 posts #3

thanks andre..but my script is in html...its always shows user doesnt exist..

andre3 Developer · 192 posts #4

now in html below hehe and it is saying user doesnt exist because the user name maybe is not in the database that u tried to login with. External image (may be gone)

<?php
echo "<html>";
echo "<head>";
echo "<title>andre3 the boss</title>";
echo "</head>";

include("config.php");

include("core.php");
connectdb();
echo "<body>";
$bcon = connectdb();
if (!$bcon)
{
   
    echo "<p align=\"center\">";
    echo "<img src=\"images/logo.gif\" alt=\"*\"/>
";
    echo "Database maintainace

";
    echo "Everyone Please go to the demo chatroom!!

";

    echo "Demo Chat:
";
echo "<a href=\"http://chat.waprank.mobi\">JamPLACE chat</a>";
    echo "</p>";

    exit();
}
$uid = $_GET["loguid"];
$pwd = $_GET["logpwd"];

$tolog = false;

  echo "<p align=\"center\">[size="1"]";

  
  $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 So Please Register again Thank u!<a href=\"register.php\">Register</a>

";
  }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

";
    }else{
      $tm = time();
      $xtm = $tm + (getsxtm()*60);
      $did = $uid.$tm;
      $res = mysql_query("INSERT INTO ibwf_ses SET id='".md5($did)."', uid='".getuid_nick($uid)."', expiretm='".$xtm."'");
      
      if($res)
      {
        $tolog=true;
      

        echo "<img src=\"images/ok.gif\" alt=\"+\"/>Save this page $uid!
";
echo "<img src=\"images/getin.gif\" alt=\"*\"/>
";
        $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."'");
      }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."' WHERE uid='".getuid_nick($uid)."'");
          
          if($res)
          {
            $tolog=true;
            echo "<img src=\"images/ok.gif\" alt=\"+\"/>Logged in successfully as $uid
";
            

          
            
          }else{
            echo "<img src=\"images/point.gif\" alt=\"!\"/>Can't login at the time, plz try later
"; //no chance this could happen unless there's error in mysql connection
            
          }
          
        }
        
      }
          }
  }
  
  if($tolog)
{
  $sid = md5($did);
  
  
echo "<a href=\"index.php?action=main&sid=$sid\">";
echo "[enter main]</a>
";

echo "
Or:<a href=\"index.php?action=chat&sid=$sid\">Join Chat</a>
";

echo "Please Bookmark this Page for auto Login
";  
echo "
";

  
    

}else{
echo "<a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
}
echo "[/size]</p>";
echo "</body>";
echo "</html>";
?>
Guest #5

lol there you goes

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