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.

 


<!-- 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.