User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,548 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,519 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 887 | Replies: 2
Reply
Join Date: Jan 2006
Location: Land of Hope & Glory
Posts: 88
Reputation: j4mes_bond25 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
j4mes_bond25's Avatar
j4mes_bond25 j4mes_bond25 is offline Offline
Junior Poster in Training

Question PHP file displaying wrongly ???

  #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 ;)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2006
Location: Land of Hope & Glory
Posts: 88
Reputation: j4mes_bond25 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
j4mes_bond25's Avatar
j4mes_bond25 j4mes_bond25 is offline Offline
Junior Poster in Training

Re: PHP file displaying wrongly ???

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Personal Website</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>


<?php include("menu.inc");?>

<div id="centerContent">
<p class="first-letter">This is the content for about.php.</p>

<p>
<?php
function ourMotto(){
    echo "We deliver quantity, not quality!<br/>";
}
ourMotto();
?>
</p>

</div>

</html>
Nope, I'm NOT God, but I'm British (which is the next best thing ;)
Reply With Quote  
Join Date: Sep 2005
Posts: 639
Reputation: digital-ether has a spectacular aura about digital-ether has a spectacular aura about 
Rep Power: 5
Solved Threads: 38
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Practically a Master Poster

Re: PHP file displaying wrongly ???

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:01 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC