----- Original Message ----- 
From: <[EMAIL PROTECTED]>
> here, try this:
> 
> :search.php:
> <?php
> if (isset($_SESSION['search']))
> {
>  $search = $_SESSION['search'];
>  //echo "<p>$search</p>";
> }
> //echo "<p><a href='index.php'>Pass a SESSION variable</a></p>";
> $_SESSION['search'] = "Hello";
> echo headers_sent()?'bad':'ok';
> ?>
> 
> 
> the thing is, the session functions use cookies. cookies are sent back to
> the client computer in the http header. if anything is echoed back to the
> client computer you can't send anything new in the header, so no new
> cookies after that point. the headers_sent() function can tell you if it
> is still ok to add more to the http headers or if the headers have already
> been sent.

Thanks Matt,
I had echoed something, don't know why I didn't see it.
Code blindness?
I stupid mistake on my half.

echo headers_sent()?'bad':'ok';
Nice tip, I'll remember that when I'm pulling my hair out again.
Regards, Bob.


Reply via email to