miniBB Support Forums | 15 years on The Web
miniBB ®

miniBB

®
 
 | Forums | Register | Search | Statistics | Manual |
Bugs miniBB Support Forums / Bugs /   
 

Undefined variable: ip

 
Author Anonymous
Guest
#1 | Posted: 11 Jul 2007 11:20 
I'm getting an error in my error_log:

PHP Notice: Undefined variable: ip in /srv/www/htdocs/forum/bb_functions.php on line 128


Here is where it comes from in bb_functions.php. Is it because it can't get an ip for some reason from the host?

function getIP(){
$ip1=getenv('REMOTE_ADDR');$ip2=getenv('HTTP_X_FORWARDED_FOR');
if($ip2!='' and preg_match("/^[0-9.]+$/", $ip) and ip2long($ip2)!=-1) $finalIP=$ip2; else $finalIP=$ip1;
$finalIP=substr($finalIP,0,15);
return $finalIP;
}

Author Team
8-)
#2 | Posted: 11 Jul 2007 11:44 
Please upgrade this function from the version what we have now in Downloads. We know about this bug and have fixed it recently.

The function should list:

function getIP(){
$ip1=$_SERVER['REMOTE_ADDR'];
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $ip2=$_SERVER['HTTP_X_FORWARDED_FOR']; else $ip2='';
if($ip2!='' and preg_match("/^[0-9.]+$/", $ip2) and ip2long($ip2)!=-1) $finalIP=$ip2; else $finalIP=$ip1;
$finalIP=substr($finalIP,0,15);
return $finalIP;
}

Bugs miniBB Support Forums / Bugs /
 Undefined variable: ip
 Share Topic's Link

This topic is closed. New replies are not allowed.

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
↑ TOP