[PHP] netscape 4.x problem
Hi, I'm having trouble getting a script working right in netscape 4.x and was wondering if anybody knew a workaround, or fix. If I have a script called sendheader.php with the following: ? if (! isset($GLOBALS[sendheader])) { header(Location: http://blah.com/sendheader.php;); exit; } echo blah; ? Load the script in netscape 4.x with http://blah.com/sendheader.php?sendheader=0. Then load the script like http://blah.com/sendheader.php and netscape returns Document contains no data. It seems to break netscape 4.x if the Location header == current script name. Does anyone know how to get around this? Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] netscape 4.x problem
When you see document contains no data like that, the most likely cause is an endless loop. So, for whatever, reason, it seems that your conditional statement is returning true every time. Remove the Location header for now, and replace that line with: echo h1Redirecting to http://blah.com/sendheader.php/h1; exit; This will allow you to see whether you are returning that Location header to the client under the different cases. My guess is that you will see this on the screen even when you don't expect to. That should give you a starting point for debugging. Chris Thomas E. Ruth wrote: Hi, I'm having trouble getting a script working right in netscape 4.x and was wondering if anybody knew a workaround, or fix. If I have a script called sendheader.php with the following: ? if (! isset($GLOBALS[sendheader])) { header(Location: http://blah.com/sendheader.php;); exit; } echo blah; ? Load the script in netscape 4.x with http://blah.com/sendheader.php?sendheader=0. Then load the script like http://blah.com/sendheader.php and netscape returns Document contains no data. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] netscape 4.x problem
Hi Tom: On Sun, Jun 23, 2002 at 01:24:57AM -0600, Thomas E. Ruth wrote: If I have a script called sendheader.php with the following: ? if (! isset($GLOBALS[sendheader])) { header(Location: http://blah.com/sendheader.php;); exit; } echo blah; ? Dude, what IS the point of this? If the $sendheader variable isn't set, you're sending the person back to the same page w/o setting the sentheader variable first... So, you've created an infinite loop. Do you mean to be doing: header('Location: http://blah.com/sendheader.php?sendheader=y'); Some other tips: When array keys are strings, put them in quotes ($GLOBALS['sendheader']) Use single quotes rather than double quotes when dealing with strings that are not being evaluated for variables in them. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php