PDA

View Full Version : Resolved Need Help with interstitial advertisement



dkblackhawk
12-03-2010, 06:20 AM
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...)


<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.

jscheuer1
12-03-2010, 08:21 AM
You have some kind of rewrite/redirect going on that changes (the real ones) - www.domain.info to domain.info. As a result:



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

can never evaluate to true, so no:



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:


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

to:


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

dkblackhawk
12-03-2010, 01:26 PM
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:


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

to:


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