I have attempted to create a script that is used on a lot of web sites. It is the little peice of code to where you have to check the box and agree to terms or when you hit the submit button it will give you a error meesage saying something like, "You must agree to the terms and guidelines before submitting." Meaning you have to check the box in order for you to continue. I can't seem to get it working with my page. The form is correct I think. Here it is.
if($action == "submit") {
if($terms == "agree") {
header("Location: /submit.php");
exit;
} else {
header("Location: other.php");
exit;
}
}
Now I have placed that at the very top of the page the form page is calling. Here is the code on the form side.
<form name="agreeterms" method="post"
action="< ?php echo "$PHP_SELF?action=submit"; ?>"
<input type="checkbox" name="terms" value="agree">
Does anyone know what I might be doing wrong or know of a different way to do this function. Thanks in advance.