How To Add A Mandatory Checkbox To Your Site

 

Resources


Checkbox Code
Put this code to the very top of the site’s source code:

<?php
$check = $_POST[‘checkbox1’];
if ($check == 1) {
header(‘location:http://www.yoururl.com/pageyouwanttodisplay.htm’);
}
?>

Put this in the body of the page where you want the checkbox to appear:

<form action=<?php echo $_SERVER[‘PHP_SELF’]; ? method=’post’>
<p>Click inside the box and click submit to continue : <input type=’checkbox’ name=’checkbox1′ value=1 /></p>
<input type=’submit’ value=’Submit’ />
</form>