If you want our help, we need to see all the code, not just the code that YOU think is relevant. What you've shown us is useless for diagnosing your problem. Show the EXACT code, not a "simple" "secure", "readable" version. Just remove passwords. ----- Original Message ----- From: "KANM MD" <[EMAIL PROTECTED]> To: "Rick Emery" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, December 11, 2002 2:54 AM Subject: Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return Values
Here is the code in a readable form (alterations for security, simplicity ...) if ((stristr($HTTP_SERVER_VARS["remote_address"],"XXX.YYY.ZZZ"))||($pwprotect== 'password')) { setcookie("pwprotect2","1",time()+300); } else { echo "<form>(ASK FOR PASSWORD)</form>"; } Now when you say "blank line" does that mean actual empty lines between the <? tag and the beginning of the code? ie <? if ((stristr(.... might cause problems? Seems kind of snarky, but I'm willing to try anything. Anyway, thanks for responding ... ON A COMPLETELY SEPARATE NOTE, does anyone here understand how the odbc_primarykeys() function ... err .. functions? Tried all avenues, kept getting an SQL Error in SQLPrimaryKey, I imagine I'm not entering proper values for the parameters, but I don't know any proper values for the parameters ... any help? Once again, thanks a lot! Kyle Hale Computer Guy KANM Student Radio Texas A&M University ----- Original Message ----- From: "Rick Emery" <[EMAIL PROTECTED]> To: "KANM MD" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, December 10, 2002 10:39 PM Subject: Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return Values > 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" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > 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 > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php