473,385 Members | 1,397 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Template Splitting Problem.

32
Hi Friends,

Iam new to PHP.i am designing a CSS layout.Now i need to split the head and footer and left parts.then include those files in every page.This is mu code How to split this.and splitted parts save to PHp files.Please help me?
[HTML]<!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>Aatapaata</title>
<link href="css/aata.css" rel="stylesheet" type="text/css" />
<link href="css/tag.css" rel="stylesheet" type="text/css" />
</head>
<body><center>
<div id="main">
<div id="headerlogo"><img src="images/1.gif" align="left"/>
<div id="toplinks">
<p>|<img src="images/home.gif" class="topimage" /><a href="#"> Home</a> |<img src="images/sitemap.gif" class="topimage" /> <a href="#"> Sitemap</a> | <img src="images/contact.gif" /><a href="#"> Reach us</a> |</p>
</div>
</div>
<div><img src="images/bg1.gif" width="800" height="2" style="background-repeat:repeat; padding-bottom:1px" /></div>
<div id="headimage"><img src="images/headerimage.gif" /></div>
<div id="navmenu">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Movies</a></li>
<li><a href="#">Register</a></li>
<li><a href="#">MyAccount</a></li>
<li><a href="#">Find a Song</a></li>
<li><a href="#">Feedback</a></li>
</ul>
</div>
</div>
<div id="page">
<div id="container">
<div id="center"></div>
<div id="leftside">
<h1>Forthcoming</h1>
<img src="images/imagelogo.jpg"/>
<h1>Find a Song</h1>
<select>
<option>Artist</option>
<option>Director</option>
<option>Music Director</option>
</select>
<div>&nbsp;</div>
<select>
<option>Artist</option>
<option>Director</option>
<option>Music Director</option>
</select>
<div>&nbsp;</div>
<select>
<option>Artist</option>
<option>Director</option>
<option>Music Director</option>
</select>
<br /><br/>
<input type="button" value="Search" name="search"/>
</div>
<div id="rightside"></div>
<div id="footer"><p>Copyright© 2008 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; | <a href="#">Disclaimer</a> | <a href="#">Privacy Policy</a> | <a href="#">Terms & Conditions</a> |</p>
</div>
</div>
</div>
</center>
</body>
</html>
[/HTML]
May 2 '08 #1
1 1220
TheServant
1,168 Expert 1GB
Make a php file called: header.php with the following:
[HTML]<!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>Aatapaata</title>
<link href="css/aata.css" rel="stylesheet" type="text/css" />
<link href="css/tag.css" rel="stylesheet" type="text/css" />
</head>
<body><center>
<div id="main">
<div id="headerlogo"><img src="images/1.gif" align="left"/>
<div id="toplinks">
<p>|<img src="images/home.gif" class="topimage" /><a href="#"> Home</a> |<img src="images/sitemap.gif" class="topimage" /> <a href="#"> Sitemap</a> | <img src="images/contact.gif" /><a href="#"> Reach us</a> |</p>
</div>
</div>
<div><img src="images/bg1.gif" width="800" height="2" style="background-repeat:repeat; padding-bottom:1px" /></div>
<div id="headimage"><img src="images/headerimage.gif" /></div>
<div id="navmenu">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Movies</a></li>
<li><a href="#">Register</a></li>
<li><a href="#">MyAccount</a></li>
<li><a href="#">Find a Song</a></li>
<li><a href="#">Feedback</a></li>
</ul>
</div>
</div>
[/HTML]And a file called footer.php:[HTML]<div id="footer"><p>Copyright© 2008 aatapaata.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; | <a href="#">Disclaimer</a> | <a href="#">Privacy Policy</a> | <a href="#">Terms & Conditions</a> |</p>
</div>
</div>
</div>
</center>
</body>
</html>[/HTML]And then in your main page you will have:[PHP]<?php
include('header.php');
?>
<div>
{YOUR PAGE CONTENT}
</div>
<?php
include('footer.php')
?>[/PHP]I have probably not broken up your code correctly, but you can put any common code in the header.php and footer.php and it will be read exactly the same as if it was all there as one file.
May 2 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Mike Brearley | last post by:
I need to create a template for an online newsletter that will auto-generate page number (with current page not hyperlinked) and previous and next buttons (no previous on first page and no next on...
9
by: Mike Brearley | last post by:
I need to create a template for an online newsletter that will auto-generate page number (with current page not hyperlinked) and previous and next buttons (no previous on first page and no next on...
5
by: Peter Oliphant | last post by:
I was thinking it might be a good idea to split this newsgroup into different newsgroups, depending on the version of VS C++.NET being discussed. Thus, there would be 2002, 2003, and 2005...
2
by: shadow_ | last post by:
Hi i m new at C and trying to write a parser and a string class. Basicly program will read data from file and splits it into lines then lines to words. i used strtok function for splitting data to...
0
by: edurazee | last post by:
I am able to create BoundFields and Footer-rows dynamically like this in my GridView: protected void Page_Load(object sender, EventArgs e) { CreateGridView(); ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.