Php Includes

admin

Administrator
Staff member
My page (<!-- m --><a class="postlink" href="http://ads.khaleel.co.uk/ad.php">http://ads.khaleel.co.uk/ad.php</a><!-- m -->)<br /><br />On each load it displays HTML ad code. For example one page load displays:<br /><br /><!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec--><!-- Powered by LedAds v2.0 - <u>http://www.ledscripts.com</u> --><a target="_blank" href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"/cgi-bin/ledads/la_click.cgi?key=2"><img border="0" height="60" src="/cgi-bin/ledads/la_image.cgi?key=2" width="468" alt="#1 Olsen fansite on the web!" /></a><!-- End LedAds v2.0 Ad Code --><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />The php code is<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?<br />//<br />Header("content-type: application/x-javascript");<br />virtual('/cgi-bin/ledads/la_ad.cgi');<br />?><!--c2--></div><!--ec2--><br /><br />My External html page where I want the add to show up has this code:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><table width="$borderwidth" cellpadding="0" border="0" width="$tablewidth" align="center" bgcolor="$bordercolor"><br /><tr><br /><td class="nav"  style="padding-bottom: 1px" bgcolor="$altbg1"><br /><center><a href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://www.khaleel.co.uk/advertise.html?refer=olsen34905039850093sfd"><br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://ads.khaleel.co.uk/newTop.gif" border="0" alt="advertise here!" width="468" height="10" /></a><br><br /><script type="text/javascript" src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://ads.khaleel.co.uk/ad.php"></script></center></td><br /></tr><br /></table><!--c2--></div><!--ec2--><br /><br />However every time I try loading this page, the advert never seems to show, it just shows an image above it (the advertise here image) but no ad below it, not even a php error<br /><br /><br />Im lost<!--content-->
I think one issue might be with this line:<br /><br />Header("content-type: application/x-javascript");<br /><br />My browser isn't reading the image tags because you told it that this is javascript.<!--content-->
I removed the javascript php header, the image works now on the adpage but It wont work in external pages, i dont want to include the page via an iframe<!--content-->
bump<!--content-->
Kaz - Read the <a href="http://www.totalchoicehosting.com/forums/index.php?act=boardrules" target="_blank">Forum Guidelines</a> about bumping threads.<br /><br />I'm sorry that nobody has responded but don't bump threads.<!--content-->
Please provide an example of what you're talking about. I would like to see a page where this isn't working.<!--content-->
<!--quoteo(post=172324:date=Mar 30 2006, 08:26 AM:name=kaz)--><div class='quotetop'>QUOTE(kaz @ Mar 30 2006, 08:26 AM) <a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=172324"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><div class='quotemain'><!--quotec--><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><table width="$borderwidth" cellpadding="0" border="0" width="$tablewidth" align="center" bgcolor="$bordercolor"><br /><tr><br /><td class="nav"  style="padding-bottom: 1px" bgcolor="$altbg1"><br /><center><a href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://www.khaleel.co.uk/advertise.html?refer=olsen34905039850093sfd"><br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://ads.khaleel.co.uk/newTop.gif" border="0" alt="advertise here!" width="468" height="10" /></a><br><br /><script type="text/javascript" src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://ads.khaleel.co.uk/ad.php"></script></center></td><br /></tr><br /></table><!--c2--></div><!--ec2--><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />The problem is your script tag:<br /><!--coloro:red--><span style="color:red"><!--/coloro--><!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto--><script type="text/javascript" src="http://ads.khaleel.co.uk/ad.php"></script><!--fontc--></span><!--/fontc--><!--colorc--></span><!--/colorc--><br /><br />It should probably be a php include:<br /><!--coloro:red--><span style="color:red"><!--/coloro--><!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto--><?php include("http://ads.khaleel.co.uk/ad.php"); ?><!--fontc--></span><!--/fontc--><!--colorc--></span><!--/colorc--><br /><br />But your main page will have to be a .php, or you'll have to add something like <!--coloro:red--><span style="color:red"><!--/coloro--><!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->AddType application/x-httpd-php .php .html<!--fontc--></span><!--/fontc--><!--colorc--></span><!--/colorc--> to your .htaccess file to get the webserver to parse PHP in an HTML page.<!--content-->
 
Top