Forum Moderators: coopster
PHP Notice: Undefined index: REQUEST_URI in c:\inetpub\wwwroot\guestbook\guestbook.php on line 41 PHP Warning: Cannot add header information - headers already sent in c:\inetpub\wwwroot\guestbook\guestbook.php on line 41
any help is very much appreciated.
My guess is that you just don't have quotation marks around the array index like so:
$_SERVER[[b]"[/b]REQUEST_URI[b]"[/b]]
Also, to get rid of the header warning you must place any calls to header [us2.php.net] before any text is output to the browser. Read it's documentation for some other fixes regarding using output buffers.
Good luck!
[edit]
Ok I take back my guess, because it throws a different error (I should have known, too)
So yes, what's that line of code :)
[/edit]
[1]PHP Notice: Undefined index: REQUEST_URI in c:\inetpub\wwwroot\guestbook\guestbook.php on line 41 PHP Warning: Cannot add header information - headers already sent in c:\inetpub\wwwroot\guestbook\guestbook.php on line 41 [1]
I don't know what went wrong...
Any help is very much appreciated...
The headers already sent error is being thrown because of the NOTICE error being dumped to the browser first. You cannot have any output whatsoever prior to the header [php.net] function, including errors.
But, that error is secondary. First, you need to find out why you don't have a REQUEST_URI index in your $_SERVER superglobal. I'm guessing it is because you are running IIS and there is no index of REQUEST_URI (you will indeed find that index in on an Apache HTTP server though). You may have to find out the equivalent on IIS.