Folks, can you help-- I have a site built around PHP....works fine. When i inserted an adsense banner, various pages stopped working. I have tried many different variations to no avail. It seems like the adsense javascript code is playing silly buggers with the PHP. Any HELP/ADVICE good Please... Many Thanks..! oh an the link if u need--- www.pictures2rate.com
Post your code. I doubt that the javascript is affecting your PHP directly, however you may have placed the javascript in the wrong place (ie. in the PHP code).
Create a new page named whatever you like. For the example we shall call it adsense.php. Place nothing on the page except the script provided by adsense, save and upload the file to your server. Now use the incude function to include that file on whatever page you want. Trying to include it into an existing table can really break things. Including it at the bottom of the header or the top of the footer is usually the easiest place. The syntax is <?php include("adsense.php"); ?> .
OK so far --- I have create a new page add.PHP and uploaded that. then linked to it but the other pages still stop loading. here is the footer.php file i am trying to insert this into. </td> </tr> </table> </div></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td background="images/bottom.gif"><table width="652" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="17"><img src="images/bottom.gif" width="22" height="47"></td> <td width="635"><div align="center"><font color="#FFFFFF" size="2" face="Tahoma, Verdana, Arial, Helvetica, sans-serif">Copyright @ 2007 <? echo $site_copyright ?></font></div> </td> </tr> </table> </td> </tr> Anymore help ??
this is really easy , first create a php file and enter in your adsense code in there , name the file as adsense.php then in your footer enter this where you would like the adsense ad to appear <? include "adsense.php"; ?> its simple enough
I understand its simple but i have tried that - the ad appears fine, then the other pages of the web site stop working, i.e- i think the parts linking to Mysql database ?! Thanks tho!!
Does this display any errors? Maybe server errors are turned off? --------------------------------------- Place the mysql connection at the top, <?php include('DB_Conn.php'); include('Header.php'); include('Content'); include('Footer.php'); ?> Code (markup): In your content.php file place the adsence code without, the use of <?php // Code ?> Maybe you placed the javascript inside the php tags?
The strange thing is i have placed a different add from CJ where i ahve been trying 2 insert flamming adsense and it works fine .... Then when i try the adsense code it goes BANG!! ..... Lol FYI-- url : www.pictures2rate.com
Is the post above the complete content of the footer.php file? If not please post the entire content of the footer file. And where are you adding the <php include?> portion I will try to get back to you quickly once you reply.
The orange html (above (ish) ) is what is contained in the footer.php file. I have tried placing the code in various parts of the table and linking to the php file from a php link...... Just seems strange thats its only adsense that balls it up ...
Since the footer is usually the last thing on the page, I do not understand why you have two table related closing tags after the table close. I failed to notice if you provided the site url or not. If you did I will take a look at it when I finish here. If not please post it or PM it to me. EDIT: I think you ought to try this one step at a time. I suggest you delete the </td> and </tr> that come just after the </table> at the bottom of the footer. Then see if the site works properly. It may not. With so nested tables those might serve a purpose but it escapes me. </table> </td> </tr> If it does work fine you are then ready to try inserting your adsense code using the include method.
Thanks 4 ur thoughts but, the extra tags are part of a nested table. </td> </tr> I have taken these out but then the template goes abit sketchy. Thanks alot. P.s the site - www.pictures2rate.com