Forum Moderators: coopster
Right now I have it set up so that a user logs in and they are brought to a "privacy policy agreement page"
the user then selects the accept button at the bottom of the page and is redirected to the correct welcome page.
What I am looking for is how to make it so that a user has to check a check box, then press the accept button to be redirected to the welcome page. And if they dont select the checkbox they are redirected to my logout page.
(Page header stuff)
<?php$welcome_page = 'welcome.php';
$logout_page = 'logout.php';
switch ($action) {
case 'update':
$privacy_check_set = $_POST['privacy_check'][0];
if ($privacy_check_set == "on") {
header('Location: ' . $welcome_page);
exit;
} else {
header('Location: ' . $logout_page);
exit;
}
break;
default:
?>
<form name="privacy" id="privacy" method="post" action="">
<table width="100%">
<tr>
<td width="80%"><label for="chk1">Click here to show you agree with the privacy policy, and click the submit button</label></td>
<td width="10%" align="center"><input id="chk1" type="checkbox" name="privacy_check[]" /></td></tr>
</table>
<input type="hidden" name="action" value="update" />
<input type="submit" name="Submit" value="Change" />
</form>
<?php
break; // end default
}
?>
(Page footer stuff)
Regards,
Nick.