ive tried a few combinations i still havnt managed to get it working. also ive looked at the software you mentioned and it is a little advanced for what i need, ive used it in the past on other sites and probably will use it if needs be in the future but its way above what i actually need at the minute, ideally i would like to get this script to work.
i have again modified the code. this should definately work <?php $a='<script type="text/javascript"><!-- google_ad_client = "pub-00000000"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "666666"; google_color_bg = "666666"; google_color_link = "ffffff"; google_color_text = "ffffff"; google_color_url = "f29935"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>'; $b='<script type="text/javascript"><!-- google_ad_client = "pub-00000022200"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "666666"; google_color_bg = "666666"; google_color_link = "ffffff"; google_color_text = "ffffff"; google_color_url = "f29935"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>'; $var = rand(1,2); if ($var==1) { echo $a; } else { echo $b; } ?> Code (markup):
i think i got ur problem. ur file is apparently a html file due to which it is not parsing the php code properly. i suggest u place this code seperately in another file named .php and then use the following command in ur html file <?php include ('ads.php'); ?>
<p align="center"><?php $a='<script type="text/javascript"><!-- google_ad_client = "pub-5768"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "666666"; google_color_bg = "666666"; google_color_link = "ffffff"; google_color_text = "ffffff"; google_color_url = "f29935"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>'; $b='<script type="text/javascript"><!-- google_ad_client = "pub-9104"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "666666"; google_color_bg = "666666"; google_color_link = "ffffff"; google_color_text = "ffffff"; google_color_url = "f29935"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>'; $var = rand(1,2); if ($var==1) { echo $a; } else { echo $b; } ?> PHP: thats th code i used i copied it exactly
no i am asking for the php code of the entire file because what i suspect is that the <?php is already open before and due to which there is some problem
ah right, well the site runs on mybb so i open up seperate files of which im putting that code into just the header, i dont think i can get the whole code of the page
<a name="top" id="top"></a> <table border="0" width="100%" cellspacing="0" cellpadding="0" background="cus/header_tile.gif" height="144"> <tr> <td width="503" valign="top"><a href="index.php"><img border="0" src="cus/headeer_left.gif"></a></td> <td valign="top"> </td> <td valign="top" width="538"> <img border="0" src="cus/headeer_right.gif"></td> </tr> <tr> <td valign="top" colspan="3" bgcolor="#000000"> <p align="center"><font face="Verdana" size="4" color="#FFFFFF"> <a href="portal.php">Portal</a> | <a href="http://www.aclubbersguide.net/misc.php?action=ttbox">Photos</a> | <a href="http://www.aclubbersguide.net/contact.php">Contact Us</a> | <a href="index.php">Forums</a> | <a href="http://www.aclubbersguide.net/forumdisplay.php?fid=2">Music News</a> | <a href="links.php">Links</a></font><font size="4" face="Verdana"></font></p></td> </tr> </table><p align="center"><?php $a='<script type="text/javascript"><!-- google_ad_client = "pub-768"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "666666"; google_color_bg = "666666"; google_color_link = "ffffff"; google_color_text = "ffffff"; google_color_url = "f29935"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>'; $b='<script type="text/javascript"><!-- google_ad_client = "pub-9301836188050104"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "666666"; google_color_bg = "666666"; google_color_link = "ffffff"; google_color_text = "ffffff"; google_color_url = "f29935"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>'; $var = rand(1,2); if ($var==1) { echo $a; } else { echo $b; } ?> </p> </div></div> <div id="container"> <div id="header"> <table width="100%" border="0"> <tr> <td><div class="logo"><a href="{$mybb->settings['bburl']}/index.php"></a></div></td> <td><div class="logo" align="right">{$easybanner}</div> </td> </tr> </table> <div id="panel"><br />{$welcomeblock} </div> </div><br class="clear" /> <div id="content">{$bannedwarning} {$bbclosedwarning} {$unreadreports} Code (markup):
The Code Worked on A Php Page Wen I Tried But I havent Test it on html page I Will test And Let U Know ASAP
Can anyone make me a set of banner rotators Its going to be in a 2x4 box. and the banners is 468x60 Easy to manage in a IPS bord. Investor1
it worked the only reason i had a problem was becase i was implamenting it on mybb - you have to add something to 1 of the files included with mybb before it works, the code itself though worked on its on, on a normal page without any problems