943,930 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1643
  • PHP RSS
May 19th, 2006
0

PHP file displaying wrongly ???

Expand Post »
I've managed to make the use of PHP's "include" function in order to share Header, Top Menu, Left Menu, Right Menu & Footer. The only exception is the Content, since it would be unique for each individual page.

Problem is, I'm getting my "Content" displaying BELOW the "Footer", as it can be seen: http://members.lycos.co.uk/darsh25/contact.php

All the files within this website can be seen on: http://members.lycos.co.uk/darsh25/

>> "menu.inc" is the PHP's include file
>> contact.php & about.php are the files that's NOT displaying content properly (where it appears to go BELOW the "Footer").
>> contact.html OR about.html shows the desired layout (these are couple of ".html" files that I first created BEFORE the ".php" version of it, although, I'll be deleting these later on, once I get the display of my ".php" files sorted out)

All I know for the fact that it's a rather silly mistake I'm making perhaps involving putting the wrong line of code in wrong file. Can anyone help ???
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
j4mes_bond25 is offline Offline
90 posts
since Jan 2006
May 19th, 2006
0

Re: PHP file displaying wrongly ???

Codes for "about.php":

PHP Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Personal Website</title>
  6. <link rel="stylesheet" type="text/css" href="style.css"/>
  7. </head>
  8.  
  9.  
  10. <?php include("menu.inc");?>
  11.  
  12. <div id="centerContent">
  13. <p class="first-letter">This is the content for about.php.</p>
  14.  
  15. <p>
  16. <?php
  17. function ourMotto(){
  18. echo "We deliver quantity, not quality!<br/>";
  19. }
  20. ourMotto();
  21. ?>
  22. </p>
  23.  
  24. </div>
  25.  
  26. </html>
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
j4mes_bond25 is offline Offline
90 posts
since Jan 2006
May 20th, 2006
0

Re: PHP file displaying wrongly ???

This is a html problem.
about.php contains the <html></html> tags which causes it to be shown at the bottom.

It actually does not matter if your included files are php or html.
They will be parsed just like php files where anything embeded between the php tags will be parsed as php.
The parent file, has to be a php file however.
Moderator
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
digital-ether is offline Offline
1,250 posts
since Sep 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Online application
Next Thread in PHP Forum Timeline: Shabba





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC