So, I'm having trouble with quite simple PHP, as I am not adept in anyway with it. So here's the code:
<?php
if(!isset ($_COOKIE['cookie'])) {
header("Location: index.html");
} else {
header("Location: index2.php");
?>
It's at the top of an HTML document, before any other HTML because I've heard header won't work otherwise (that statement could prove my ignorance itself). But basically, I have an agreement page you must agree to before continuing to the site, but it's not considered my index file. So I need this redirect to detect the if the cookie that is set by the agreement.php exists or not, and I assume that this syntax is correct, but it seemingly doesn't work. I used an echo "
Any ideas on how to fix? Thank you in advance.