Shoutbox

[SOLVED] PHP and table issues - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: [SOLVED] PHP and table issues (/showthread.php?tid=86057)

[SOLVED] PHP and table issues by Th3rmal on 09-20-2008 at 04:38 PM

Ok so ive made a website (not currently publicly available :P) and to make things a little easier for myself, i have incorporated some _really_ simple PHP.

Atm my index.php file is as follows:

code:
<html>
<body>

<?php include 'header.html' ?>

    <td class="main">
      hello
    </td>
<?php include 'footer.html' ?>

</body>
</html>


Now in the output, the "hello" is not produced, in fact anything in between the two php lines is not produced; even though the header.html and footer.html render perfectly.

Some info:
as you can tell, the info inside the two <php> lines is part of a table.
There are no unclosed tags inside any of the documents, and im pretty sure all the code is fine.

Also another note, having all 3 files together (header.html + footer.html + index.php - its php) in a single .html file works correctly and renders everything.

Can anyone help me?

Thanks
RE: PHP and table issues by andrewdodd13 on 09-20-2008 at 04:48 PM

Don't you have to do
include (<filename>)
?

Also, I assume that header and footer contain yer
<table><tr>
and
</tr></table>
yeah?


RE: PHP and table issues by tony on 09-20-2008 at 04:52 PM

<?php include ("something.php");?> ;)


RE: PHP and table issues by absorbation on 09-20-2008 at 04:56 PM

<?php include 'header.html'; ?>

    <td class="main">
      hello
    </td>
<?php include 'footer.html'; ?>

Try it with the semicolons. Have you turned error reporting off? Also your table syntax is incorrect, you need a <table> and <tr> tag :).


RE: PHP and table issues by Felu on 09-20-2008 at 04:57 PM

Why not have the <html><body> and </body></html> in header.php and footer.php respectively?

You might want to add <head> tags too...


RE: PHP and table issues by L. Coyote on 09-20-2008 at 09:50 PM

quote:
Originally posted by andrewdodd13
Don't you have to do
include (<filename>)
?
It's not mandatory to use () for include(_once) and require(_once).



Do you have any PHP code in the *.html files? If there's PHP code in them, make sure you created the correct AddHandler/AddType entries in the .htaccess file of the directory you're using, to render *.html files as PHP. Or simply rename them to *.php.
RE: PHP and table issues by Th3rmal on 09-20-2008 at 11:34 PM

quote:
Originally posted by andrewdodd13
Don't you have to do
include (<filename>)
?
Nope, doing it without the brackets has worked before.
quote:
Originally posted by andrewdodd13
Also, I assume that header and footer contain yer
<table><tr>
and
</tr></table>
yeah?
Yes i do :)
quote:
Originally posted by absorbation
Try it with the semicolons.
Same result :(
quote:
Originally posted by absorbation
Also your table syntax is incorrect, you need a <table> and <tr> tag (Smilie).
The opening tags of the table are part of the header.html and closing tags are a part of footer.html :)
quote:
Originally posted by Felu
Why not have the <html><body> and </body></html> in header.php and footer.php respectively?

You might want to add <head> tags too...
Changed, but it didnt solve my problem :P Thanks anyway.
quote:
Originally posted by L. Coyote
Do you have any PHP code in the *.html files?
No i dont. the .html files only contain html code. Only the index.php has those two lines of php.

EDIT: Fixed. It was reading off the wrong index file.
* Th3rmal slaps himself

Sorry to waste your time :-$