Thread: IF Visited
View Single Post
Old 01-12-2013, 09:32 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
You can do that in PHP, I just don't know why you wouldn't use the JS anyway since its required to show the code.
PHP Code:
<?php

$iDuration 
5;

$bShowIt = !isset($_COOKIE['lastShown']) || isset($_COOKIE['lastShown']) && (time() - $_COOKIE['lastShown']) > $iDuration true false;

if (
$bShowIt)
{
    
setcookie('lastShown'time(), time() + $iDuration);
    
// do whatever you gotta do to show it
    
printf('Show something every %d seconds'$iDuration);
}
Looks like it'd do the trick. Server languages tend to limit their reliance on cookies as much as they can.
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
peteyshivery (01-12-2013)