I want to have a bit of code I can whack on my site, which will make a popup window appear once every X days (30 in my case). I have seen sites which show you a popup once every visit, once every 24 hours... but I don't know how they do it.
You could do something like this. <?php if (date('j') == 1) { echo '<script type="text/javascript"> <!-- window.open(\'something.html\', \'window\', \'\'); //--> </script>'; } ?> Code (markup): This would show a pop up every first day of a month.
They use cookies. Set a cookie that will expire in 30 days and check if it exists or store the current date to cookie and check if 30 days have elapsed from the date stored to that cookie.
Is setting up a cookie easy to do? I am not really familiar with any of this coding business. Do you have a tutorial?