Hello , can anyone help me get a popup code that shows only after 24 hours , based on cookies i think .. thx lots in advance
This is not possible without a persistent connection to the users machine or by installing software on the users machine to count down the time until the popup should be displayed. For software installed on a machine, it only needs to save the install time and then wake every minute to see if it time to display the message. If you do either of these things without explicit permission from users, your URL and/or code will be flagged for inclusion in anti-spyware, malware, adware and/or anti-virus databases. If you are talking about a popup that would be displayed only when a visitor returns to your site and only if it has been at least 24 hours since the previous visit, putting the time in a cookie would be the correct approach. However, it will fail on systems where cookies are routinely erased.
I think you may mean on a website, ie. if it's been 24 hours since the last one. This is probably what you want to do... <?php if(!$_COOKIES['popup']) { setcookie('popup',1,time()+(24*60*60) echo 'javascript popup code'; } else { $Other_Code; } Code (markup):