You could use a header() with Location: but why do you need to reload
the page?  If you already have your data in $form_value then the data is
already available to you.

If you are using a newer version of PHP (> 4.1) you can reference the
information from the $_COOKIE array as well.

You could do this: 

if ($form_value != "0"){
        setcookie("mycookie",$form_value,time() + 30660);
        $cookie = $form_value;
} elseif (isset($HTTP_COOKIE_VARS["mycookie"])) {
        $cookie = $HTTP_COOKIE_VARS["mycookie"];
}

There are a number of other ways you could do it as well but that should
help you think about it.

Jason

On Sun, 2003-01-05 at 09:12, 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"){
>         setcookie("mycookie",$form_value,time() + 30660);
>         // Web should be reload here;
>         }
> $cookie = $HTTP_COOKIE_VARS["mycookie"];
> 
> 
> Any suggestion?
> 
> Thanks,
> Tackel.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to