Jump to content

need help:- Integration of header, menu and footer in php.


lovelyjitu

Recommended Posts

Hi Guys,

 

I want to create a simple home page with a header, menu and footer. So, I create three tables Ist is for header.php, IInd is for menu.php and IIIrd is for footer.php and menu.php and footer.php contains as:-

 

Home

contact us

about us

link

 

Here is the codding for it as given:---

=========================================

<html>

<head>

<title>My First Web Site</title>

<link rel="stylesheet" type="text/css" href="style.css" />

</head>

<body>

<table height="80" width="100%"  border="5" ><td width="160"</table>

<table height="100%" border="5" width="100" cellspacing="0" cellpadding="2">

<tr>

<td valign="top" align="left" width="80">

<br /><br /><br /><br />

<a href="file:///C:/Documents%20and%20Settings/rajkumar/Desktop/data.html">Home</a>

<a href="contact.php">Contact Us</a>

<a href="aboutus.php">About Us</a>

<a href="links.php">links</a>

 

</td></tr></table>

<table height="80" border="5" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td valign="center" align="center" width="100%">

<a href="file:///C:/Documents%20and%20Settings/rajkumar/Desktop/data.html">Home</a>

<a href="contact.php">Contact Us</a>

<a href="aboutus.php">About Us</a>

<a href="links.php">links</a>

 

</td></tr></table>

 

</body>

=======================================

 

But I want to If I click on any of

contact us

about us

link

It should open in the middle part of the template. So, tell me plz

how it can be done and give me coding for it if possible.

 

Thanks.

 

Link to comment
Share on other sites


<!-- start header.php -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <title>My First Web Site</title>
</head>
<body>
<!-- end header.php (should include your menu to) -->

<!-- start footer.php -->
</body>
</html>
<!-- end footer.php -->

<!--
    start index.php
    echo file_get_contents is faster then include_once()
-->
<?php echo file_get_contents("header.php");?>

<!-- start content -->
<table height="80" border="5" width="100%" cellspacing="0" cellpadding="2">
<tr>
    <td valign="center" align="center" width="100%">
        <a href="data.html">Home</a><!-- file:// won't work -->
        <a href="contact.php">Contact Us</a>
        <a href="aboutus.php">About Us</a>
        <a href="links.php">links</a>
    </td>
</tr>
</table>
<!-- end content -->

<?php echo file_get_contents("footer.php");?>

 

i was so friendly to correct your html code, i also suggest you read PHP 5 Advanced which will give you an introduction into modules: http://www.amazon.com/PHP-Advanced-Visual-QuickPro-Guide/dp/0321376013

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.