In mc code any place that has this code<br>
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'])
? $_SERVER['HTTP_X_FORWARDED_FOR']
: $_SERVER['REMOTE_ADDR'];
should be replaced with this
$ip=$_SERVER['REMOTE_ADDR'];
The original code (posted first) can cause errors in ip logging which makes you less able to maintain your games security.
thats helpful but sadly i wouldnt use that method hehe
but eh lets go threw it all
as standard mccodes it would look like this
$IP = ($_SERVER['HTTP_X_FORWARDED_FOR'])
? $_SERVER['HTTP_X_FORWARDED_FOR']
: $_SERVER['REMOTE_ADDR'];
and needs changed in the following files i have listed below
header.php
login.php
register.php
forums.php
global_func
authenticate.php
also here is another way other then using
$ip=$_SERVER['REMOTE_ADDR'];
or you can use
$IP = $_SERVER['REMOTE_ADDR'];
$IP=addslashes($IP);
$IP=mysql_real_escape_string($IP);
$IP=strip_tags($IP);
which of both are going to prevent users from performing a hack known as the "IP Hack"
also reason why
$IP = ($_SERVER['HTTP_X_FORWARDED_FOR'])
? $_SERVER['HTTP_X_FORWARDED_FOR']
: $_SERVER['REMOTE_ADDR'];
allows people to perform the IP Hack is because of the firefox addon called X-Forwarded-For Spoofer 1.0.2 is basically being called upon when you insert something like
hi', user_level='2
which on most mccode games the admin level is 2 so when they insert this into the addon it makes them admin