ci cookies to show popup-add 1 hr interval |
hi,
i am new to php, ci and also in this forum. i want to show a popup-add once an hour. after 1 hour, if the user refreshes the page, the add will be shown again. but if user refreshes the site within 1 hour, the add won't be shown. can i do it using ci built-in class using cookies? or there is any other way. pls suggest... thanks in advance.
CI has it out of the box ;o) You should use the session driver instead of the cookie helper.
http://www.codeigniter.com/userguide3/li...l#tempdata The example shows a message for 60 seconds. Code: $this->session->set_tempdata('example', 'Hello folks!', 60); The set_tempdate method couldnt called in the same controller method because it would be allways overwritten. So set it from another method or from another controller. |
Welcome Guest, Not a member yet? Register Sign In |