this is prolly all wrong but heres my try:
Code:
<script language="javascript">
{
if document.cookie = useralreadycanceled;
}
} else {
input_box=confirm("You have not registered on the forums, or are not logged in. Click OK to register, or cancel to hide this prompt.");
if (input_box==true) { // Output when OK is clicked
second_box=confirm("Open in new window?\n\n(Press cancel to open in the current window.)");
if (second_box==true) {
window.open('register.php?s=$session[sessionhash]','register','width=750,height=500,menubar=no,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes,top=50,left=50');
} else {
window.location="register.php?s=$session[sessionhash]";
}
} else {
}
}
function setCookie()
{
var timeout=60*60*24;
document.cookie = useralreadycanceled;
}
-->
</script>
what im trying to do is create a cookie, make the cookie expire in 24 hours. if the user comes back 24 hours later it will show him the message. so basicly it looks like this
User clicks cancel
cookie gets written
if the cookie exists it doesnt execute the pop-up code
user comes back 24 hours later he gets the pop-up again