Tylor Posted September 26, 2008 Posted September 26, 2008 <?php session_start(); if(get_magic_quotes_gpc() == 0) { foreach($_POST as $k => $v) { $_POST[$k]=addslashes($v); } foreach($_GET as $k => $v) { $_GET[$k]=addslashes($v); } } include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } if ($_POST['username'] == "" || $_POST['password'] == "") { die("<h3>{$set['game_name']} Error</h3> You did not fill in the login form! <a href=login.php>> Back</a>"); } $uq=$db->query("SELECT userid FROM users WHERE login_name='{$_POST['username']}' AND `userpass`=md5('{$_POST['password']}')"); if ($db->num_rows($uq)==0) { die("<h3>{$set['game_name']} Error</h3> Invalid username or password! <a href=login.php>> Back</a>"); } else { $_SESSION['loggedin']=1; $mem=$db->fetch_row($uq); $_SESSION['userid']=$mem['userid']; $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $db->query("UPDATE users SET lastip_login='$IP',last_login=unix_timestamp() WHERE userid={$mem['userid']}"); if($set['validate_period'] == "login" && $set['validate_on']) { $db->query("UPDATE users SET verified=0 WHERE userid={$mem['userid']}"); } header("Location: loggedin.php"); } ?> Quote
Tylor Posted September 26, 2008 Author Posted September 26, 2008 Re: authenticate.php is there something wrong with it then Quote
Haunted Dawg Posted September 26, 2008 Posted September 26, 2008 Re: authenticate.php You can not just post code and ask is there something wrong with it. Tell us if any thing is wrong and then we correct it. Quote
Tylor Posted September 26, 2008 Author Posted September 26, 2008 Re: authenticate.php well my sites working so theres not anymore Quote
Cronus Posted September 26, 2008 Posted September 26, 2008 Re: authenticate.php Whats the point in this post. Quote
Tylor Posted September 27, 2008 Author Posted September 27, 2008 Re: authenticate.php the points is it wasnt working before Quote
Cronus Posted September 27, 2008 Posted September 27, 2008 Re: authenticate.php Uhm, whats the point of this post. Quote
Dave Posted September 27, 2008 Posted September 27, 2008 Re: authenticate.php I was going to ask you. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.