View Single Post
Old 11-23-2007, 05:37 AM   #3 (permalink)
iisbum
The Wanderer
 
Join Date: Nov 2007
Posts: 20
Thanks: 1
iisbum is on a distinguished road
Default

Couldn't you just set the cookie to expire in 24 hours and if it exists, don't show the ad?

PHP Code:
if(!isset($_COOKIE['last_displayed'])) {
  
setcookie('last_displayed'date("Y-m-d h:i:s"), time() + (24 3600), '/');
  echo 
'Show Advert';

Instead of figuring out the the hours in the PHP. I always like to do as little as possible :)

Mubs
iisbum is offline  
Reply With Quote