Re: Question Regarding Cookies, Sent Headers, and Functions That Return Values
| From: | Rick Emery | Date: | Wed, 11 Dec 2002 04:39:43 +0000 |
| Subject: | Re: Question Regarding Cookies, Sent Headers, and Functions That Return Values | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127756@lists.php.net to get a copy of this message | ||
Hey Aggie,
Show us the rst of the code. stristr() should not be a problem. Chances are there's a
blank line elsewhere that's being sent.
----- Original Message -----
From: "KANM MD" <md@kanm.tamu.edu>
To: <php-general@lists.php.net>
Sent: Tuesday, December 10, 2002 2:34 PM
Subject: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return Values
Here's my question:
I'm running code that essentially checks for either a certain IP address or a password
before it sends a cookie. However, when I try to send the cookie, I get the standard
"Error - headers already sent" when I haven't output anything. After some spot
debugging,
I found that
if ( stristr($HTTP_SERVER_VARS["remote_address"],"XXX.YYY.ZZZ") ) { ...
essentially counts as a sent header. I imagine this has to do with the fact that stristr
returns a TRUE or FALSE value, but not being an expert in programming concepts, I wouldn't
know.
Anywho, if anyone knows a workaround for this or could explain the problem that lies
within, it would be greatly appreciated.
Thanks,
Kyle Hale
Computer Guy
KANM Student Radio
Texas A&M University