Forum Moderators: coopster

Message Too Old, No Replies

Adding a "Privacy Agreement" Page

Adding an intermediate page after the login page

         

wbarrett26

6:16 pm on Mar 2, 2005 (gmt 0)

10+ Year Member



I am relatively new to php so any comments or help is appreciated.

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.

nickknowledge

12:30 am on Mar 4, 2005 (gmt 0)

10+ Year Member



This seems to work:

(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.

wbarrett26

6:35 pm on Mar 4, 2005 (gmt 0)

10+ Year Member



Thanks a lot.
I got a headers are already sent error.
There is an include at the top of the page so I think I might have to make this stuff part of the include so the headers will work. I will keep at it
If there is any other advice please let me know.