What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [SOLVED] PHP and table issues

[SOLVED] PHP and table issues
Author: Message:
Th3rmal
Veteran Member
*****

Peek-a-boo! I see you!!

Posts: 1226
Reputation: 26
32 / Male / Flag
Joined: Aug 2005
O.P. [SOLVED] PHP and table issues
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

This post was edited on 09-21-2008 at 12:52 AM by Th3rmal.
You have the intellect comparable to that of a rock. Be proud.
09-20-2008 04:38 PM
Profile E-Mail PM Web Find Quote Report
andrewdodd13
Senior Member
****

Avatar
Oh so retro

Posts: 870
Reputation: 16
34 / Male / Flag
Joined: Jan 2005
RE: PHP and table issues
Don't you have to do
include (<filename>)
?

Also, I assume that header and footer contain yer
<table><tr>
and
</tr></table>
yeah?
[Image: AndrewsStyle.png]
09-20-2008 04:48 PM
Profile E-Mail PM Web Find Quote Report
tony
Senior Member
****

Avatar

Posts: 976
Reputation: 54
36 / Male / Flag
Joined: Jul 2004
RE: PHP and table issues
<?php include ("something.php");?> ;)
[Image: beginnerbadgeef2.gif][Image: danceichigoow9.gif]
09-20-2008 04:52 PM
Profile PM Web Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
RE: PHP and table issues
<?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 :).
09-20-2008 04:56 PM
Profile PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: PHP and table issues
Why not have the <html><body> and </body></html> in header.php and footer.php respectively?

You might want to add <head> tags too...
09-20-2008 04:57 PM
Profile E-Mail PM Web Find Quote Report
L. Coyote
Senior Member
****

Avatar
Captain Obvious

Posts: 981
Reputation: 49
38 / Male / Flag
Joined: Aug 2004
Status: Away
RE: PHP and table issues
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.

Hack, hack, hack!
Finally became a Systems Analyst! :spam:

09-20-2008 09:50 PM
Profile PM Find Quote Report
Th3rmal
Veteran Member
*****

Peek-a-boo! I see you!!

Posts: 1226
Reputation: 26
32 / Male / Flag
Joined: Aug 2005
O.P. RE: PHP and table issues
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 :-$

This post was edited on 09-21-2008 at 12:51 AM by Th3rmal.
You have the intellect comparable to that of a rock. Be proud.
09-20-2008 11:34 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On