Forum Moderators: coopster
I want to achieve something but i cant figure out how!
1- User submit form (DONE)
2- Set Cookie/variable or whatever other (PHP/JS) solution after form submission (Not Done)
3- User click the Browser Back Button
4- I check if cookie/variable was set then i direct user to some other page!
I just want the algorith and the tool ... not necessary the code :)
Also is it possible to set php cookie after the page is submitted then check it by javascript on 2nd page by using
<body onLoad=CheckPhpCookie();>
Anyways in Short all i want is that i direct the user to some page when they click the Browser Back Button after form submission!
Thanks in advance
<?php
session_start();
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
then i added this now but no reaction but the cached page....
if(isset($HTTP_COOKIE_VARS['TestCookie'])) {
header("Location: http*://www.redirect.com/");
exit;
}
When i pres the back button they display message that the previous page contains POST data that are expired from the Cache... So it refresh the page and then i redirect it because there is session that doesnt exit after the submission... but IE6 cache everything no matter what...
I am sure that all developers faces same problem with IE cache but hopefully there exist the solution!
Thanks again
to the code just to see what is going on with cookies.
HTH