Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to develop a header file like
this


in which top header and left header would be the same throughout web pages.

I have also created the same,but i am stuck here that how to show data in dynamic contents field. here is my code to the header.php file:

XML
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<style>

main2{
    font-family:myFirstFont1;
    font-size:12px;

}

.image {
    position: absolute;
    left: 17px;
    top: 159px;
}
.image1 {


}
.image2 {

}
.image3 {

}

.main_divs{
    display:inline-block;
    float:left;
}
#left{
    width:200px;
    height:750px;
    position:fixed;
    margin-top:150px;
}
#upper{
    width:100%;
    float:left;
    position:fixed;
    display:inline-block
}


#logo{
    width:352px;
    margin-top:50px;
}



#navigation{

}




#logo,#navigation{
    float:left
}
#inner-nav{
    float:right;
    margin-left: 200px;
}
.left_parts{
    height:50%;
    border-radius:10px;
    border:2px solid black;
    margin-top:10px;
}
#left-part1{
    background-color:#0093dd;

}
#left-part2{

    background-color:#bfff00;
}

main{
    font-family:myFirstFont1;
    margin-left:30px;
    font-size:22px;

}
main1{
    font-family:myFirstFont2;
}
</style>

</head>

<body>

<div id="upper" class="main_divs">
    <div id="logo"><img  src="images/Shoppin online .png" width="325px" height="50"/></div>
    <div id="navigation">
    <div id="inner-nav">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="35">
    <main2><h3>&nbsp;<a href="index.html">HOME </a>&nbsp;&nbsp;|&nbsp;&nbsp; ABOUT US &nbsp;&nbsp;|&nbsp;&nbsp;CONTACT &nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;<img src="images/twitter.png" width="21" height="17" />&nbsp;&nbsp;|&nbsp;&nbsp;<img src="images/youtube.png" width="20" height="11" />;&nbsp;&nbsp;|&nbsp;&nbsp;<img src="images/fb.png" width="10" height="21" />&nbsp;&nbsp;|&nbsp;&nbsp;<img src="images/in.png" width="20" height="14" />&nbsp;&nbsp;|&nbsp;&nbsp;<img src="images/p.png" width="16" height="21" />&nbsp;&nbsp;|&nbsp;&nbsp;<img src="images/setting.png" width="19" height="21" />&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="signup.html">SIGNUP</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="login.php">LOGIN</a></h3>
    </main2>
     </td>
  </tr>
  <tr>
    <td height="40"><div class="image2"><input type="text"   value="Search" maxlength="80" style="width:580px;height:25px;background-color:#bfff00" class="search">
    <div class="text">
    <main1><h2 class="t3"></h2></main1>

    </div>
    </div>
    </td>
  </tr>
  <tr>
    <td height="35"><div class="image2"><input type="text"   value="Category" name="category" id="category" maxlength="80" style="width:100px;height:25px;background-color:#bfff00" class="search1"> &nbsp;<input type="text"   value="Product Name" maxlength="80" style="width:120px;height:25px;background-color:#bfff00" class="search1">&nbsp; <input type="text"   value="Brand" maxlength="80" style="width:100px;height:25px;background-color:#bfff00" class="search1">&nbsp; <input type="text"   value="Price Range" maxlength="80" style="width:120px;height:25px;background-color:#bfff00" class="search1">&nbsp; <input type="text"   value="Color" maxlength="80" style="width:85px;height:25px;background-color:#bfff00" class="search1"></div></td>
  </tr>
</table>
</div>
    </div>
</div>

<div id="left" class="main_divs">
<div id="left-part1" class="left_parts">Offers</div>
<div id="left-part2" class="left_parts">New Arrivals</div>
</div>

</body>
</html>



and when i include header.php in any page and insert contents,they are displayed on the top of the webpage and the header.php is displayed.

here is my test.php file in which i am including header.php.

XML
<?php
include_once("header/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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Testing</title>
</head>

<body>

tetsdfhgdfkgdfhgdfg




</body>
</html>




and the result shows like this
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900