Exit Splash Cookie to Prevent Showing More than Twice?

5 replies
Hi,

What code can I implement to set a cookie when exit splash shows? And then check so that it only shows for a maximum of not more than twice?
#cookie #exit #prevent #showing #splash
  • Profile picture of the author kip
    Really depends how your exit splash is coded. We would need to see some code examples.
    {{ DiscussionBoard.errors[8766321].message }}
  • Profile picture of the author DonsWpDylan
    It depends on how the exit splash is coded. If you're just in php or javascript, then check if there's a cookie for the exit splash, and if not, then show the splash and set a cookie.
    {{ DiscussionBoard.errors[8766721].message }}
    • Profile picture of the author MindReality
      Originally Posted by DonsWpDylan View Post

      It depends on how the exit splash is coded. If you're just in php or javascript, then check if there's a cookie for the exit splash, and if not, then show the splash and set a cookie.
      I using the Exit Splash by Dave Guindon:
      http://www.exitsplash.com/

      I place this code at the bottom of my page to activate it:

      Code:
      <!-- Start of ExitSplash.com Code -->
      <script language="javascript">
      var exitsplashalertmessage = '***************************************nn       > > > W A I T < < <nn     CLICK THE **STAY ON PAGE** BUTTONn    on the NEXT Window for a special  n           FREE EBOOK GIFT!nn***************************************';
      var exitsplashmessage = '***************************************nn    W A I T  B E F O R E  Y O U  G O!nn I HAVE SOMETHING VERY SPECIAL FOR YOU!nn      CLICK "CANCEL" BUTTON TO STAY!nn***************************************';
      var exitsplashpage = 'http://www.mindreality.com/facebookgift.html';
      </script>
      <script language="javascript" src="http://www.greatgenius.com/exitsplash.php?tc=3399cc&ua=1&uh=none&ad=none&sh=no&hv=no&bh=22&fs=12&lf=Arial&at=Powered%20by%20ExitSplash"></script>
      <!-- End of ExitSplash.com Code -->
      Where should I implement code to check for cookie or set cookie? In my main page, or in the exitsplash.php page?
      Signature
      Discover The Greatest Secrets Of The Mind And Reality That Will Get You Anything You Desire, Almost Like Magic! Visit: http://www.MindReality.com
      {{ DiscussionBoard.errors[8767186].message }}
      • Profile picture of the author DonsWpDylan
        It ultimately comes down to whatever you're more comfortable coding in. You can do it in either, since the exit splash is done in both languages. Here is how you do it in php, and here is it in javascript.

        Personally, I would do it in php. Something like this:

        PHP Code:
        if( !array_key_exists('user_has_seen_exit_splash',Array))//if the cookie dosen't exist
        {

          
        //exit splash stuff goes here

          
        cookie_time time() + 60 60 24 365//cookie will last one year
          
        setcookie("user_has_seen_exit_splash""1"cookie_time); //set the cookie

        Note: cookie_time should be $cookie_time, the forum software likes to delete php variables when they're enclosed in the code tag
        {{ DiscussionBoard.errors[8769347].message }}
        • Profile picture of the author MindReality
          Originally Posted by DonsWpDylan View Post

          It ultimately comes down to whatever you're more comfortable coding in. You can do it in either, since the exit splash is done in both languages. Here is how you do it in php, and here is it in javascript.

          Personally, I would do it in php. Something like this:

          PHP Code:
          if( !array_key_exists('user_has_seen_exit_splash',Array))//if the cookie dosen't exist
          {

            
          //exit splash stuff goes here

            
          cookie_time time() + 60 60 24 365//cookie will last one year
            
          setcookie("user_has_seen_exit_splash""1"cookie_time); //set the cookie

          Note: cookie_time should be , the forum software likes to delete php variables when they're enclosed in the code tag
          Thanks, how do I set a variable counter so that it increases each time the exit splash is shown, and then check whether it is shown twice so that it can prevent it from displaying a third time?
          Signature
          Discover The Greatest Secrets Of The Mind And Reality That Will Get You Anything You Desire, Almost Like Magic! Visit: http://www.MindReality.com
          {{ DiscussionBoard.errors[8771640].message }}

Trending Topics