Hi there,
Im setting a cookie in a page and then refresh the page to test if the cookie was set or not and Im using a GET variable to acomplish my mission of testing if the cookie was set or not.
My script:
<?
if (!isset($HTTP_GET_VARS[C]))
{
setcookie("TestCookie", "Test"
;
Header("Location: $PHP_SELF?C=1"
;
}
else
{
if (isset($HTTP_COOKIE_VARS[TestCookie]))
{
echo "Cookie is set $HTTP_COOKIE_VARS[TestCookie]";
}
else
{
echo "Cookie was not set";
}
}
?>
My question is:
I just want to set a GET variable but I want it to be hidden to the page's viewers, can I? Because it (GET variable) looks ugly in the URL, and one more thing, if the user delete the GET variable from the URL and hit enter, the cookie will be recreated!
So, I want to get rid of the GET variable?
I apreciate your kind help
Im setting a cookie in a page and then refresh the page to test if the cookie was set or not and Im using a GET variable to acomplish my mission of testing if the cookie was set or not.
My script:
<?
if (!isset($HTTP_GET_VARS[C]))
{
setcookie("TestCookie", "Test"
Header("Location: $PHP_SELF?C=1"
}
else
{
if (isset($HTTP_COOKIE_VARS[TestCookie]))
{
echo "Cookie is set $HTTP_COOKIE_VARS[TestCookie]";
}
else
{
echo "Cookie was not set";
}
}
?>
My question is:
I just want to set a GET variable but I want it to be hidden to the page's viewers, can I? Because it (GET variable) looks ugly in the URL, and one more thing, if the user delete the GET variable from the URL and hit enter, the cookie will be recreated!
So, I want to get rid of the GET variable?
I apreciate your kind help