Hi, I'm trying to get a message similar to a popup to appear when anyone visits my Wordpress blog and then not appear for that same user for another 60 hours. The message appears OK, but it does so every time a page from the site is loaded in that session, it doesn't wait the 60 hours. I've attached the header.php file from my Wordpress theme and a file called cookiemanager.php which is also used as part of the process. Please could someone take a look and tell me what I've done wrong and how to correct it? Thanks, Joe
Change this if ($_COOKIE[$trackingCode] == "visited") { return ""; } else { return "showSqueezePage();"; } PHP: into this and try again if (isSet($_COOKIE[$trackingCode])) { return ""; } else { return "showSqueezePage();"; } PHP: Why? if the cookie has expired it will be removed! or not used anymore! only validate cookie content when you need to know certain this from this user (views on pages, last url, etc)
Thanks for the help Eric, but it's still not working correctly. Now I get the message the first time in Firefox and after that I get a message with a 404 error. In IE I get the message the first time and then I get a little image missing symbol which when I click on it I get a 404 error and when I close that page I get a message saying [object Error]. Have you get any other ideas for what I can do? Thanks again, Joe
I added the code and now it's alternating between the message and the 404 page on each visit to any page on the blog.