<?php
include 'vars.php';
set_time_limit(0);
putenv("TZ=Asia/Calcutta");
$conn = mysql_connect($hostname,$username,$pass)Or DIE ("Unable to connect to database");
mysql_select_db($dbname, $conn);
global $name,$pass,$userid,$sex,$nam,$password,$flag;
$userid = $_REQUEST['userid'];
$userid=strtoupper($userid);
$password = $_REQUEST['password'];
$query = "SELECT name,password,lastlogin FROM binaryusers where userid = '$userid'";
$res = mysql_query($query)or die ("Bad query: " . mysql_error() );
if (mysql_fetch_row($rs))
{
global $name, $pass, $sex, $nam,$lastlogin;
$nam = mysql_result($res,0,0);
$pass = mysql_result ($res,0,1);
$lastlogin=mysql_result ($res,0,2);
if ($pass==$password&&$userid!='')
{
global $userid,$pass,$lastlogin;
session_start();
$_SESSION['user'] = $userid;
$_SESSION['pass'] = $pass;
$_SESSION['pinlogin']=0;
$_SESSION['lastlogin']=$lastlogin;
$jtime=time();
$query="update binaryusers set lastlogin='$jtime' where userid='$userid'";
mysql_query($query);
echo "<meta http-equiv=\"REFRESH\" content=\"0;url=memberlogin.php\">";
}
else
{
echo "userid or password is incorrect";
}
}
else
{
echo "userid or password is incorrect";
}
?>
vinodpaul 0 Newbie Poster
LastMitch
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
neatric 0 Newbie Poster
SagarSe7en 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.