saeed_violinist Posted December 14, 2006 Share Posted December 14, 2006 Dear friends,Im trying to make a pop-up in my page. I done it fine and pop-up "floating layout" is displaying fine. I just want that my users see this pop-up once a week (time is not so important but not less than a day pls!) .I know it must be done with help of cookies and a if statement ...please help me do this.I mean something like this :if (new user) {show pop-up } else { dont show!}thanks Link to comment https://forums.phpfreaks.com/topic/30655-how-to-identify-a-returning-user-and-run-a-code-once-for-him/ Share on other sites More sharing options...
SharkBait Posted December 14, 2006 Share Posted December 14, 2006 So something like:[code]<?phpif(isset($_COOKIE['myCookie'])) { ShowPopUp();}?>[/code][/code] Link to comment https://forums.phpfreaks.com/topic/30655-how-to-identify-a-returning-user-and-run-a-code-once-for-him/#findComment-141270 Share on other sites More sharing options...
saeed_violinist Posted December 14, 2006 Author Share Posted December 14, 2006 thanks, I dont have created any cookie myself until now, I want to try it myself now. if I cant sucess or I sucess I will write it here ;D Link to comment https://forums.phpfreaks.com/topic/30655-how-to-identify-a-returning-user-and-run-a-code-once-for-him/#findComment-141306 Share on other sites More sharing options...
saeed_violinist Posted December 14, 2006 Author Share Posted December 14, 2006 hey Im cool :d[code]<?phpSetCookie("popupshown", "yes", time()+ 3600);if (!isset($_COOKIE["popupshown"])) { ShowPopUp()}?>[/code]Works great! Link to comment https://forums.phpfreaks.com/topic/30655-how-to-identify-a-returning-user-and-run-a-code-once-for-him/#findComment-141323 Share on other sites More sharing options...
saeed_violinist Posted December 14, 2006 Author Share Posted December 14, 2006 ok, but is there a better way to do this job ? Link to comment https://forums.phpfreaks.com/topic/30655-how-to-identify-a-returning-user-and-run-a-code-once-for-him/#findComment-141328 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.