| 8:38 am on Nov 3, 2006 (gmt 0)|
Welcome to WebmasterWorld Othenz,
what is on line 41?
is this stopping your script? I notice the headers already sent error there too.
| 11:28 am on Nov 3, 2006 (gmt 0)|
My guess is that you just don't have quotation marks around the array index like so:
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.
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 :)
| 11:19 pm on Nov 3, 2006 (gmt 0)|
The header error is appearing because of the text generated by the undefined error. Check out eelixduppy's excellent advice, which I`m sure is the problem.
| 7:51 am on Nov 3, 2006 (gmt 0)|
System: The following 2 messages were spliced on to this thread from: http://www.webmasterworld.com/php/3146246.htm [webmasterworld.com] by coopster - 4:54 pm on Nov. 6, 2006 (utc -6)
I got this error message below in my php guestbook. I'm using IIS as my webserver.
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 
I don't know what went wrong...
Any help is very much appreciated...
| 10:49 pm on Nov 6, 2006 (gmt 0)|
Welcome to WebmasterWorld, Othenz.
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.