Or with PHP. That's more reliable, in that PHP, if you have it available, will work no matter what the user has enabled (as long as cookies are enabled, but there is no other way, other than using a server side database storing each person as a user or IP).
Use this form:
Code:
<form action="next.php" method="post">
<input type="submit" name="submit" value="agree">
</form>
Put this code on the top of the page that points to (form action="this.php")
PHP Code:
<?php
if ($_POST['submit']=='agree') {
setcookie('agree',1);
}
?>
And for the index page, use this code (at the top) to check if they have agreed:
PHP Code:
<?php
if ($_COOKIE['agree']==1) {
header('Location: http://my.com/full/path/realindex.htm');
}
You may also want an else statement in one or the other, to redirect if that fails, but I'm not sure how you want to handle that.
Bookmarks