Wow, its working now:
<?
if (!isset($HTTP_POST_VARS[C]))
{
if (isset($HTTP_COOKIE_VARS[TestCookie]))
{
setcookie("TestCookie", "Test");
}
?>
<form name="TestCookieForm" action="<?=$PHP_SELF?>" method="POST">
<input type="hidden" name="C" value="1">
</form>
<script language="javascript"> document.form.submit(); </script>
<?
}
else
{
if (isset($HTTP_COOKIE_VARS[TestCookie]))
{
echo "Cookie is set $HTTP_COOKIE_VARS[TestCookie]";
}
else
{
echo "Cookie was not set";
}
}
?>
But still I have one more problem and its a major one 😕
If I include this code in every single page I have, then if the page that Im including this code to, have a form, then all the POST variables in the main form will be discarded since I have an intermidiate form that check the cookie setting 😕
I hope its clear, my question now:
The POST variables in the MainForm (look to the code down) can I save them in an array and then I can use them later (i.e. after the execution of the (TestCookieForm)?
Example:
<?
include(TheAboveCode.php);
?><form name="MainForm" action="<?=$PHP_SELF?>" method="post">
<input name="test1">
<input name="test2">
<input type="submit">
</form><?
One more time, I hope that Im clear 🙂
PLEEEEEEEEEEEEEEASE HEEEEEEEEEEEEEEEEEEEEEELP 🙂