News:

Wondering if this will always be free?  See why free is better.

Main Menu

Can't install my hosts Ads

Started by Chirantha, October 27, 2005, 02:36:46 AM

Previous topic - Next topic

Chirantha

Hi,

My host says I have to put ads. How ever I can't put it. I also know a little about PHP and the thing is that when I put the index.template.php its using echo so my ad code cannot be echo'ed.

Here is the code....

<script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
document.write ("&amp;what=zone:1&amp;target=_blank");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&amp;referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>


Please help because my host will kick me out if I fail to put the ads in the most populer pleace in the forum.

Thank you,
Chirantha

Elmacik

your code is broken too much,
try this:

echo '
<script language="JavaScript" type="text/javascript" src="http://x10hosting.com/advert/adx.js"></script>
<script language="JavaScript" type="text/javascript">
<!--
if (!document.phpAds_used) document.phpAds_used = \',\';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

document.write (\'<" + "script language="JavaScript" type="text/javascript">\');
document.write (\'http://x10hosting.com/advert/adjs.php?n=" + phpAds_random\');
document.write (\'&amp;what=zone:1&amp;target=_blank\');
document.write (\'&amp;exclude=" + document.phpAds_used\');
if (document.referrer)
document.write (\'&amp;referer=" + escape(document.referrer)\');
document.write (\'\'><" + "/script>\');
//-->
</script><noscript><a href="http://x10hosting.com/advert/adclick.php?n=a7fb3e9d" target="_blank"><img src="http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d" border="0" alt=""></a></noscript>';

if this doesnt work, please send the exact codes that your host gave
Home of Elmacik

Chirantha

It didn't work  :( I didn't change the ad code that my host gave. The frist post contans the original code that my host gave.

JayBachatero

do you get any errors when you insert the code?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Chirantha

When I insert the original SMF says that there is template error. And when I instered the code you'll gave it loaded but the ad didn't appear and at the bottom of the IE window it said that there was an sintax error.

PLEASE HELP

Elmacik

Then try your "original" codes echoed,

echo '
<script language=\'JavaScript\' type=\'text/javascript\' src=\'http://x10hosting.com/advert/adx.js\'></script>
<script language=\'JavaScript\' type=\'text/javascript\'>
<!--
if (!document.phpAds_used) document.phpAds_used = \',\';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

document.write ("<" + "script language=\'JavaScript\' type=\'text/javascript\' src=\'");
document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
document.write ("&amp;what=zone:1&amp;target=_blank");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&amp;referer=" + escape(document.referrer));
document.write ("\'><" + "/script>");
//-->
</script><noscript><a href=\'http://x10hosting.com/advert/adclick.php?n=a7fb3e9d\' target=\'_blank\'><img src=\'http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d\' border=\'0\' alt=\'\'></a></noscript> ';
Home of Elmacik

Chirantha

#6
I solved it my self!!! :D

The problem was that ad codes (Scripts that use other laguages) canot be executed in side a php code ( after the <?php). And ad codes cannot echo because it has to be exeucted on the page. So what I did was to end the php code in the index.template.php file with a ?> and added ad code were I wanted it to and re opened php with a <?php. And it worked PERFECTLY  :D.

I hope this post will help alot of people having this problem.

See my board :D www.chiranthasoft.cjb.net/forums/

Thank you,
Chirantha

Advertisement: