mealto Posted July 18, 2008 Share Posted July 18, 2008 We run a cookie based popup (php script) that runs a popup for our newsletter sign up. It works when a user first visits our website and right away writes a cookie for 24 hours. Within this time frame, no popups are served. If they choose the "Never show me this offer" link in the popup, a 365 day cookie is written ensuring they will never (for 365 days) get the popup as long as the cookie is in place. Here is where we are stuck. We want to delay the popup until the user views the 2nd page view on our site. So the first cookie write will need to write an integer to the cookie I assume, then on a 2nd pageview, have the script look for the integer and decide if the popup needs to be served. Is there a tutorial that can show us how to accomplish this? We are newbies and require the syntax for the script to read and write the cookie. Any help would be appreciated here. Link to comment https://forums.phpfreaks.com/topic/115362-cookie-help-fire-on-2nd-pageview/ Share on other sites More sharing options...
corbin Posted July 18, 2008 Share Posted July 18, 2008 http://php.net/set_cookie How do you plan on handling it if the user doesn't have cookies enabled, since you will never know if it's their 2nd visit? Link to comment https://forums.phpfreaks.com/topic/115362-cookie-help-fire-on-2nd-pageview/#findComment-593115 Share on other sites More sharing options...
mealto Posted July 19, 2008 Author Share Posted July 19, 2008 Thanks for the link corbin. We actually used that tutorial to set our cookies. The issue now is to leave some sort of trail so our popup fires on page 2 of the user's visit. Can you help? For those who have cookies disabled, they will not get the popup. That is just something we have to live with. Link to comment https://forums.phpfreaks.com/topic/115362-cookie-help-fire-on-2nd-pageview/#findComment-594284 Share on other sites More sharing options...
mealto Posted July 22, 2008 Author Share Posted July 22, 2008 Any more hints? Link to comment https://forums.phpfreaks.com/topic/115362-cookie-help-fire-on-2nd-pageview/#findComment-596086 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.