Re: web reload
| From: | Marek Kilimajer | Date: | Sun, 05 Jan 2003 17:14:47 +0000 |
| Subject: | Re: web reload | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130329@lists.php.net to get a copy of this message | ||
Yes, you are right $cookie = $HTTP_COOKIE_VARS["mycookie"]; should be in *else* part
Jason Sheets wrote:
This will always assign the value of $HTTP_COOKIE_VARS["mycookie"] to $cookie, overwriting the $cookie = $form_value assignment which is what you want if the page is being reloaded but is not what is desired on the first page load. Jason On Sun, 2003-01-05 at 09:50, Marek Kilimajer wrote:TACKEL wrote:Hi, I have a php file that set up a cookie that receives from a form and also uses it. My problem is the first time the value is submitted via form. The cookie is setup but I cannot not use it so I'd need to reload the web after setting up the cookie. Myfile.php if ($form_value != "0"){// you should use if(isset($form_value)) {$cookie=$form_value; // and no need to reloadsetcookie("mycookie",$form_value,time() + 30660);-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php}$cookie = $HTTP_COOKIE_VARS["mycookie"]; Any suggestion? Thanks, Tackel.