hi my login is working on my computer, but when i tried 2 computers from 2 different locations, they couldnt login. any help greatly appreciated. thanks. derek. its setting the hack variable to Y on remote computers.
// escape username and password for use in SQL//person said on board "looks fine" like this //to prevent sql injections $u = mysql_real_escape_string($u); $p = mysql_real_escape_string($p);
// if fields username and password have contents, then... if(isset($u) && isset($p) && !empty($u) && !empty($p)){ ///changed from if ($u && $p)
$query = mysql_query("SELECT * FROM table2 WHERE username = '$u' AND password = '$p'");
$result = mysql_fetch_array($query);
if($result['username']){ // if username is set, go on...username is a key for $result, and a field in the table.
$message = "You have been logged in";
$_SESSION['userid'] = $result['username'];
header("Location:old.mainsite.php"); // this will redirect them to the application.php page. and exit the script here. exit;
}else{
$message = "You do not exist on the system";
}
} ?> <?php //IP BANNING CODE START HERE $s=$_SERVER["REMOTE_ADDR"]; //draws IP address of visitor $ipbancheck="SELECT * from banip where IP='$s'"; $ipbancheck2=mysql_query($ipbancheck); while($ipbancheck3=mysql_fetch_array($ipbancheck2)) { $IPBANNED=$ipbancheck3[IP]; } //above lines check to see if user Ip is in banned IPs if ($IPBANNED) { header('Location: http://derekvanderven.com/hacker.html'); //print "You have been banned ";