I'm having an issue with Xampp 1.7.2 and I can't put my finger on what the problem is.
I have the following snippet of code on my guilds everquest website and it runs fine.
However, when I run the same code on my local installation of Xampp I get these errors:
Failed to execute query.
Warning: Cannot modify header information - headers already sent by (output started at G:\htdocs\eqdkp\common.php:68) in G:\htdocs\eqdkp\includes\functions.php on line 430
- Code: Select all
/**
* Part for checking black listed IP-s.
*/
$con = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname);
while (true) {
$sql = "SELECT *"
. " FROM `blacklist`"
. " WHERE `ip` = '" . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . "'";
if (($mysqlRez = mysql_query($sql)) === false) {
echo 'Failed to execute query.';
break;
}
if (mysql_num_rows($mysqlRez) > 0) {
// die('Your IP is on our blacklist');
header("location: http://www.google.com/");
exit();
break;
}
break;
}