//********************************************************************************* // Nama Script : SCRIPT SOCIAL COMMUNITY 2016 LATEST VERSION FULL RESPONSIVE // Original Script By : Ahmad Saiful Mujab // Facebook : http://facebook.com/ahsaimu // Facebook Pages : https://www.facebook.com/1001script // Twitter : https://twitter.com/ahsaimu // Phone : 0878 2977 5554 / (0231) 638436 // Pin BBM : 5873732B / 5B2B42BD // Email : ahmadsaifulmujab@gmail.com // Website : http://1001script.com //********************************************************************************* session_start(); include "../config.php"; include "../fungsi.php"; global $c; include "../data.php"; global $config; if ($_GET["action"]=="logout") { if(isset($_COOKIE["username"]) && isset($_COOKIE["password"])) { $HTTP_COOKIE_VARS["username"] = ""; setcookie(username,"x",time() - 7776000); $HTTP_COOKIE_VARS["usPass"] = ""; setcookie(password,"x",time() - 7776000); header("Location: index.php"); exit(); } } if ($_POST['email']) { $email=saiful($_POST['email']); $password=md5(saiful($_POST['password'])); if($_POST['captcha'] != $_SESSION['captcha']){ header("Location: login.php?error=3"); }else{ if ($email==NULL) { header("Location: login.php?error=1"); }else{ if ($password==NULL) { header("Location: login.php?error=2"); }else{ $query = mysql_query("SELECT * FROM tb_users WHERE email = '$email'") or die(mysql_error()); if(mysql_num_rows($query) == 0) { header("Location: login.php?error=5"); } else { $data = mysql_fetch_array($query); if($data['password'] != $password) { header("Location: login.php?error=4"); }else{ $query = mysql_query("SELECT * FROM tb_users WHERE email = '$email'") or die(mysql_error()); $row = mysql_fetch_array($query); $nicke=$row['username']; $passe=$row['password']; setcookie("usNick",$nicke,time()+3600); setcookie("usPass",$passe,time()+3600); setcookie("username",$nicke,time()+3600); setcookie("password",$passe,time()+3600); $lastlogdate=time(); $lastip = $_SERVER['REMOTE_ADDR']; $querybt = "UPDATE tb_users SET lastlogdate='$lastlogdate', lastiplog='$lastip' WHERE username='$nicke'"; mysql_query($querybt) or die(mysql_error()); header("Location:index.php"); } } }} }} ?>