Hi,
I am using setcookies to store one single value.
But i was reading http://za2.php.net/manual/en/function.setcookie.php and i
noticed that a cookie might not be accepted yet it might return true.
So that makes me wonder what the use of the cookies are if i have no way of
making sure that it has been properly accepted.
What is the point of having cookies if i have to make a backup plan for
users that do not accept them? What do you do for those users?
Am i right in assuming that cookies are only used as a bonus, for example to
remember a user name and some minor settings.
Now for my variable, how can i remember the value even if the user refreshes
the page?
I have global values like...
if( !isset($foo) ){
$foo = "value is set";
echo "Setting foo";
}else{
echo "foo is".$foo;
}
if i load the page $foo is set but then is i refresh the page the value is
lost, why?
Why does php not remember the global value $foo?
I tried
$HTTP_GET_VARS['foo'] = $foo;
$HTTP_POST_VARS['foo']= $foo;
But that does not save the value when the page is refreshed, (the same page
is refreshed).
Sims
I am using setcookies to store one single value.
But i was reading http://za2.php.net/manual/en/function.setcookie.php and i
noticed that a cookie might not be accepted yet it might return true.
So that makes me wonder what the use of the cookies are if i have no way of
making sure that it has been properly accepted.
What is the point of having cookies if i have to make a backup plan for
users that do not accept them? What do you do for those users?
Am i right in assuming that cookies are only used as a bonus, for example to
remember a user name and some minor settings.
Now for my variable, how can i remember the value even if the user refreshes
the page?
I have global values like...
if( !isset($foo) ){
$foo = "value is set";
echo "Setting foo";
}else{
echo "foo is".$foo;
}
if i load the page $foo is set but then is i refresh the page the value is
lost, why?
Why does php not remember the global value $foo?
I tried
$HTTP_GET_VARS['foo'] = $foo;
$HTTP_POST_VARS['foo']= $foo;
But that does not save the value when the page is refreshed, (the same page
is refreshed).
Sims
Comment