Undefined index errors ??? Undefined index errors ???
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Undefined index errors ???

Started by Tallman027, November 07, 2003, 06:29:03 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Tallman027

Hi all,
First of all the best gallery ever !!!

However theres one little thing I'm having trouble with.......
On every page I get the following errors, even though the gallery seems to work perfectly............any ideas ?

Warning: Undefined index: SCRIPT_NAME in /www.shorehambysea.com/coppermine/include/init.inc.php on line 91

Warning: Undefined index: REMOTE_ADDR in /www.shorehambysea.com/coppermine/include/init.inc.php on line 98

If anyone would like a closer look please go to
http://www.shorehambysea.com/coppermine and let me know what you think...........

Many thanks,

Tallman027

Joachim Müller

seems like the version of php running on your server doesn't support the env vars needed. Edit init.inc.php and replace $SCRIPT_NAME and $REMOTE_ADDR with the env vars that are supported on your server (probably $_SERVER["SCRIPT_NAME"] and $_SERVER["REMOTE_ADDR"]) - see your phpinfo() to check what server vars are supported.

GauGau

Tallman027

Many thanks for the reply.

I did as you advised and checked my phpinfo(). I found the following:

_ENV["SCRIPT_NAME"]           =          /fcgi-bin/php  (not inc "=")
_ENV["REMOTE_ADDR"]          =           81.128.16.116  (not inc "=")

So it looks as if its supported. I'm running PHP 4.1.2 by the way.

Any further ideas or advise on exactly how I change the inti.inc.php - I'm kind of a newbie at PhP so please be gentle with me !!!

Many thanks
Tallman027

Joachim Müller


Tallman027

Gaugau,
Many thanks that fixed the SCRIPT_NAME issue however I still have the REMOTE_ADDR problem at the top of the page.

Sorry to bother you yet again, however if you have any further excellent advise, it would be much appreciated.

Cheers !
Tallman027

Joachim Müller

try replacing$raw_ip = stripslashes($HTTP_SERVER_VARS['REMOTE_ADDR']);with$raw_ip = stripslashes($_SERVER["REMOTE_ADDR"]);or$raw_ip = stripslashes($_ENV["REMOTE_ADDR"]);
If this doesn't work for you, just comment line 98 out (you'll only lose the banning feature):// $raw_ip = stripslashes($HTTP_SERVER_VARS['REMOTE_ADDR']);GauGau