session_start();
include("config.php");
if($_COOKIE['zmusrno'])
{
list($id , $cred , $key)= explode("|" ,$_COOKIE['zmusrno']);
$q = "SELECT userid FROM customer WHERE '$id' = md5(userid::text || '$key') AND md5(login ||'|'|| password) = '$cred' ";
$r = pg_query($q) or die(pg_last_error());
$row = pg_fetch_array($r);
if($row['userid'])
{
header("Location: memberlogin.php");
die();
}
}
include("header.php");
include("../private.zulfiqar.co.jp/phpMailer/send_mail.php");
if ( $LOGOUT == 1 )
{
if ( $ZAAUID > 0 )
{
if( file_exists("/tmp/sessionid-$ZAAUID") )
{
unlink("/tmp/sessionid-$ZAAUID");
}
}
$ZAAERR = "";
$ADMIN = 0;
}
if($recover_login)
{
$db = pg_connect("host=auction port=5432 dbname=auction user=auction");
$forgot_email = htmlentities($forgot_email,ENT_QUOTES);
$sSQL = "SELECT username, login, password FROM customer WHERE login = '$forgot_email' ";
$result = pg_query($db,$sSQL) or die(pg_last_error());
$line = pg_fetch_array($result, null, PGSQL_ASSOC);
if(pg_num_rows($result) )
{
$msg = "Dear ".$line[username].",
Your login detils for ZULFIQAR MOTOR CO., LTD are as follows
";
$msg .= "Login: ".$line[login]."
Password: ".$line[password]."
";
$msg .= " Support Team";
send_mail($forgot_email,"ZULFIQAR MOTOR CO., LTD Login Details",$msg,"From: info@zulfiqaraa.com\nContent-Type: text/html");
$forgot_email_sent = 1;
}
else
$forgot_email_error = 1;
}
$ZCOOKIEOK = 1;
$_SESSION['ZAAUID'] = 0;
$q2 = "DELETE from otp WHERE otp_expirydate < current_date ";
$r2 = pg_query($q2);
?>