Results 1 to 3 of 3

Thread: Need Help with interstitial advertisement

  1. #1
    Join Date
    Sep 2008
    Posts
    44
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Need Help with interstitial advertisement

    I need some immediate help...on my site http://bit.ly/ewrYeg (Had to use bit.yl to prevent search issues....etc)

    I am trying to run some interstital ads, I have it all running and everything but I think I have messed up on the javascript code. The problem is that the ad page actually doesn't load at all. I have the code below in the header but it won't activate.

    Here is the code that is used for the advertisement script, help getting this working will get money in paypal (5-10 bucks, depending on how major I messed up...)

    Code:
    <script type="text/javascript">
    var name = "interstitial";
    
    function ReadCookie(cookieName) {
       var theCookie=""+document.cookie;
       var ind=theCookie.indexOf(cookieName);
       if (ind==-1 || cookieName=="") return "";
       var ind1=theCookie.indexOf(';',ind);
       if (ind1==-1) ind1=theCookie.length;
       return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
    }
    
    function WriteCookie(cookieName) {
       var now = new Date();
       var nextday = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 0, 0, 0, 0);
       var expires = "; expires=" + nextday.toUTCString();
       document.cookie = cookieName+ '=yes' + expires + '; path=/; domain=.domain.info';
    }
    
    if (ReadCookie(name) != 'yes' && window.location.host == 'www.domain.info') {
       WriteCookie(name);
       window.location="/interstitial.php?url=" + window.location;
    }
    </script>
    where is says domain.info is where the site url normally is.
    Last edited by dkblackhawk; 12-03-2010 at 03:46 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You have some kind of rewrite/redirect going on that changes (the real ones) - www.domain.info to domain.info. As a result:

    Code:
    if (ReadCookie(name) != 'yes' && window.location.host == 'www.domain.info') {
    can never evaluate to true, so no:

    Code:
       WriteCookie(name);
       window.location="/interstitial.php?url=" + window.location;
    ever gets done.

    There could also be other problems, but that much has to be fixed first, change:

    Code:
    if (ReadCookie(name) != 'yes' && window.location.host == 'www.domain.info') {
    to:

    Code:
    if (ReadCookie(name) != 'yes' && window.location.host == 'domain.info') {
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2008
    Posts
    44
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    You have some kind of rewrite/redirect going on that changes (the real ones) - www.domain.info to domain.info. As a result:



    can never evaluate to true, so no:



    ever gets done.

    There could also be other problems, but that much has to be fixed first, change:

    Code:
    if (ReadCookie(name) != 'yes' && window.location.host == 'www.domain.info') {
    to:

    Code:
    if (ReadCookie(name) != 'yes' && window.location.host == 'domain.info') {
    ...
    I
    Love
    You
    Lol, send me a pm for your paypal e-mail.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •