You are here:  » Undefined index error


Undefined index error

Submitted by netsprite on Sun, 2006-03-26 20:55 in

Hi

I am getting the following error reported on all /admin pages (line numbers vary):

Notice: Undefined index: PHP_AUTH_USER in D:\my\file\path\index.php on line 40

The script works normally despite this however it's not quite right. Running PHP5 on Win2003 development server....

Anybody have any suggestions on how to remove this problem?

Thanks

Submitted by support on Sun, 2006-03-26 21:02

Hi,

I've realised this is a potential problem on a small number of installations and removed the cause of this error (which only occurs because warnings are turned up to the max on your server) in the new distribution.

To remove the warnings for the time being (without having to change your PHP configuration), add the following line to your config.php (doesn't matter where):

  $_SERVER["PHP_AUTH_USER"] = "dummy";

This basically sets the index that PHP is saying is not set. If you subsequently add authentication to your admin area with .htaccess you will need to remove this line; as it is the HTTP authentication that sets this value in the first place.

Hope this helps!

Submitted by netsprite on Sun, 2006-03-26 21:29

Nice one - job done.

Preview of the new distribution is looking good too. Looking forward to trying it out soon.

Thanks