Jump to content

johnnylak

New Members
  • Posts

    3
  • Joined

  • Last visited

johnnylak's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm sorry, I'll try and be a little more specific. I have a modal window that pops-up when a visitor lands on my page. However, I don't want the modal to appear again straight away hence I have placed the time to expire after a short while. In the head I have not set a cookie. I have set the cookie straight after the body tag by using the code snippet above. When testing to see if the cookies has been set by using another if statement and echo'ing the result it seems to have not been set. If however, I set the cookies in the head it does set but then I am unable to achieve the result I am trying in the above snippet. Handball Player - The kind of kind you ask for is the snippet I've provided. It's php and javascript and i've moved it to just under the body tag. Confused - It doesn't crash, the cookie just does not set. I am using those special tags because if I don't the snippet it being read correctly and then the whole page crashes. I hope this is much more clarity. You're help in invaluable. Thanks heaps, Johnny
  2. Regardless of where I place that code snippet I have provided. it does not work.
  3. Hello, I have a modal box on my site and don't want it to show up each time a user refreshes a page. I have placed this code on my HTML site and it works fine, however when I place it in my Wordpress blog it does not work. I placed this code snipped after the head tag and before the body tag. I'v also tried to set the cookie in the head first but then can't figure out the logic to run the modal. <?php if (!isset($_COOKIE['modal'])){ setcookie("modal", "true", time()+3660, "/"); ?> <script type="text/javascript"> $(window).load(function(){ $('#modal-box').modal('show'); }); </script> <? } ?> Any thoughts or suggestion would be highly appreciated. Thanks, Johnny
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.