Included file, HTML after does not show

Website is: http://www.ngsolitaries.com
if you want to see it.

So I’ve included the following code through an include statement:
[php]<?php
/* This script will select valid the valid company based on today’s date and display their ad */?>Put YOUR Ad Here

<?php $q = mysql_query("SELECT * FROM adinfo") or die(mysql_error()); //Select all from table adinfo $today = date("Y-m-d"); //save today in string, YYYY-MM-DD format while($row = mysql_fetch_array($q)){ //While loop saves query data if($row['date_begin'] <= $today ){ //if today is later than or equal to begin date if($row['date_end'] >= $today){ //if today is earlier than or equal to end date if($row['adspace'] == 3){ //CHANGE THIS PER THE AD SPACE YOU WANT TO DEFINE, 1-7 $compname = $row['company_name']; //Save company name in a string $r = mysql_query("SELECT id FROM sponsors WHERE company_name='$compname' ") or die(mysql_error()); //Select id# from sponsors while($abc = mysql_fetch_array($r)){ //While loop saves query data echo ""; //display image based on company's id# } //bracket for while loop } //bracket for if row adspace = 1 else { echo ""; //Default image is there is no ad for this space } //bracket for else } //bracket for if row dateend > today } //bracket for if row datebegin < today } //bracket for while row = array(q) ?>[/php]

It works fine when it’s on it’s own page, but when I include it using an include statement such as:

<table width="125" height="125" cellpadding="0" cellspacing="0"><tr><td bgcolor="#D3E0D9" background="images/sidebox_bg.gif" align="center"><?php include("adbox3.php"); ?></td></tr></table>

When I do the above, any HTML code that comes after the include doesn’t show. Any guidance?

I’m sorry. There was a mistake in my code I hadn’t found. Someone pointed it out to me elsewhere.

I had commented out my HTML using , but it had not commented out some PHP that was within it, so it was still trying to run scripts it shouldn’t have been.

Sponsor our Newsletter | Privacy Policy | Terms of Service