PHP file displaying wrongly ???

Reply

Join Date: Jan 2006
Posts: 89
Reputation: j4mes_bond25 is an unknown quantity at this point 
Solved Threads: 0
j4mes_bond25's Avatar
j4mes_bond25 j4mes_bond25 is offline Offline
Junior Poster in Training

PHP file displaying wrongly ???

 
0
  #1
May 19th, 2006
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 ???
Nope, I'm NOT God, but I'm British (which is the next best thing ;)
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 89
Reputation: j4mes_bond25 is an unknown quantity at this point 
Solved Threads: 0
j4mes_bond25's Avatar
j4mes_bond25 j4mes_bond25 is offline Offline
Junior Poster in Training

Re: PHP file displaying wrongly ???

 
0
  #2
May 19th, 2006
Codes for "about.php":

  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>
Nope, I'm NOT God, but I'm British (which is the next best thing ;)
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,083
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: PHP file displaying wrongly ???

 
0
  #3
May 20th, 2006
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.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1374 | Replies: 2
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC