include function not working..
Posted: Thu Aug 22, 2002 10:08 am
I have been trying to get the include function to return a section for a template i am constructing. But when I try to use the include function it just returns 1.
Header.php
Then on my main page I have :
Test.php
then later on...
any suggestions?
Header.php
Code: Select all
<?php
$date = date("F j, Y");
$display = "
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="38%"><div align="center"><img src="http://www.navigatormag.com/images/TopLogo.gif" width="269" height="60"></div></td>
<td width="62%"><div align="center">
<?php
require(getenv('DOCUMENT_ROOT').'/Ads/phpadsnew.inc.php');
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_id = view ('468x60', 0, '', '', '0', $phpAds_context);
?>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="15" background="http://www.navigatormag.com/GUI/RowBack.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="82%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="7%"> </td>
<td width="93%"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="http://www.navigatormag.com/index.php">Home</a></td>
<td width="30"> </td>
<td><a href="http://www.navigatormag.com/Archive.php">Article
Archive</a></td>
<td><img src="http://www.navigatormag.com/GUI/VertSpacer.gif" width="15" height="9"></td>
<td><a href="http://www.navigatormag.com/Contests.php">Contests</a></td>
<td><img src="http://www.navigatormag.com/GUI/VertSpacer.gif" width="15" height="9"></td>
<td><a href="http://www.navigatormag.com/Coupons.php">Coupons</a></td>
<td><img src="http://www.navigatormag.com/GUI/VertSpacer.gif" width="15" height="9"></td>
<td><a href="http://www.navigatormag.com/TravelGames.php">Travel
Games</a></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="18%"><div align="center">$date</div></td>
</tr>
</table></td>
</tr>
</table>
";
return $display;
?>Test.php
Code: Select all
<?php
$header = include 'http://www.navigatormag.com/Header.php';
?>Code: Select all
<? echo $header; ?>