Forum Moderators: martinibuster
Problem is, my website is a forum which uses a global header. So the adcode is in there and automatically gets put on the register login and search page.
Here are the pages I DONT want the code on..
/index.php?act=Search
/index.php?act=Reg&CODE=00
/index.php?act=Login&CODE=00
So, Id like some javascript to go around the banner code something along the lines of..
If ((url = register_page) OR (url = login page) OR (url = search page))
{
dont do anything
}
else
{
google ad code in here
}
Can anyone help with this, I thought about getting the URL, and checking to see if charat wherever the R for register in the url should be is an R.. etc..
Hope you understand,
Cheers
Tom.
Seeing as I have removed my google ad until I get it sorted, you may as well have a look -
<snip>
The advert is 'hard coded' into each and every page automatically as its the global header.
Cheers for the reply but I dont quite understand :S
[edited by: Jenstar at 4:21 pm (utc) on Mar. 23, 2004]
[edit reason] NO URLS as per TOS, please! [/edit]
<script language='JavaScript' type='text/javascript'>
var url = window.location.href;
if ((url.indexOf("Search")!= -1) ¦¦ (url.indexOf("Reg")!= -1) ¦¦ (url.indexOf("Login")!= -1))
{
document.write("");
}
else
{
google code.
}
</script>
I do not want to cause a panic for you, but it looks to me that you have changed the AdSense code!
I'm not sure if you are aware of this, but you are not allowed to do this!
Your AdSense code looks like this to me (and I guess all others who look at it!)
</style>
<script type="text/javascript"><!--
google_ad_client = "pub-REMOVED";
google_ad_width = 125;
google_ad_height = 125;
google_ad_format = "125x125_as";
//--></script>
</head>
It also looks like you are missing the
http://pagead2.googlesyndication.com/pagead/show_ads.jspart..
Noel
[edited by: Noel at 9:51 pm (utc) on Mar. 22, 2004]
Lets look at my login page:
login.php:
<?
$googlead = "off";
include('header.php');?
content here....
content here....
content here....
<? include('footer.php');?>
Now lets take a look at my header.php:
content here....
content here....
<?php if($googlead!= "off") {
display google ad
}
?>
That's how I do it, somewhat.. and it works great.