So at the moment I'm scrapping together the functions or aspects of it all in block pieces. I think the cookie part is done, and the setting of the cookie.
aup.php (squid redirect)
PHP Code:
<?
// DURATION FUNCTION FOR COOKIE, 12HOURS
$duration = time()+(60*60*12);
// CHECK COOKIE, HAS USER PREVIOUSLY ACCEPTED AUP?
if (!$aup_accepted)
{
$accepted = $_POST[accepted];
}
else
{
$accepted = $aup_accepted;
} // NEED TO ADD IF ACCEPT REDIRECT, IF NOT DISPLAY AUP+FORM
// SET COOKIE FOR AUP DETECTED, WITH DURATION OF 12HOURS.
if ($_POST[accepted] == "Yes")
{
setcookie("aup_accepted", $duration);
}
// REDIRECT
header("Location:]");
?>
Which is that function, and the form is simply:
Code:
<div align="center">Do you accept this Acceptable Usage Policy?</div>
<FORM METHOD="POST" ACTION="aup.php">
<input type="submit" name="accepted" value="Yes">
<input type="submit" value="No" <!-- need to add a function here to do null, or JS to close browser? -->>
</FORM>
I'm not that great at PHP, I do have my PHP for dummies book on my desk, I think, somehow I'll cobble it all together, contribution most welcome ;]