Re: Simple cookie question
| From: | Mike Migurski | Date: | Sun, 10 Aug 2003 00:42:10 +0000 |
| Subject: | Re: Simple cookie question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159005@lists.php.net to get a copy of this message | ||
>There are two ways round your problem...
>
>1. Set your cookie right at the top of the script, so as your first line
>have something like: if(isset($_POST['vote'])){ setcookie(....); }
>
>2. Use output buffering, this will make PHP buffer all of your content
>and not send it till you tell it to (or until it reaches the end of the
>file). Read more at: http://uk.php.net/ref.outcontrol
3. Use PHP's session features. Start your session at the top of the page,
like usual, and then set a flag in $_SESSION when the poll is is
completed. This will allow you to set other arbitrary flasg as well.
See: http://php.net/session
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html