PDA

View Full Version : Including php in tables


Neticus
01-28-2006, 02:36 AM
Hi, Im not a coder however pick up basic code insertions here and there. Have just discovered the 'include' statement however am unable to include php in tables. It just fails to appear or comes out literally as text. Please, how would I write the php include code below so as it gets processed?



<?php
<table width="100%" cellpadding="0" cellspacing="0" border="0">
include("nav.php");

</table>
?>

Help appreciated!
Thanks

fci
01-28-2006, 02:40 AM
if it's coming up with no errors, you may want to set display_errors = on in your php.ini as well turning on any other error notices.
the problem you are having is a syntax error, you want to do something like this instead:
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<?php include("nav.php"); ?>
</table>

or, another example:
<?php
print '<table width="100%" cellpadding="0" cellspacing="0" border="0">';
include("nav.php");
print '</table>';
?>

anything between the <?(or <?php) and ?> tags are interpreted