Dear Members
I am new to PHP. I design static pages using HTML. I am creating a PHP site. I have created two files as follows.
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>Untitled Document</title>
<link href=../CSS/Headerstyles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="1">
<tr>
<td class="headerbackground"><a href="#" class="headerlink">Home</a></td>
</tr>
</table>
</body>
</html>
Home 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>Untitled Document</title>
</head>
<? php include ('Header.PHP');?>
<body>
<table width="100%" border="1">
<tr>
<td > </td>
</tr>
</table>
</body>
</html>
The above code done for including the Header.php file in the Home.php file is working in design time but not on runtime. Please suggest
Thanks in advance
Including PHP files
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Including PHP files
0.o What is the problem that you are having with the code? Remember that if you include a file, that whole file is included, meaning (in this case) you are getting multiple tags, double html headers which is maybe why you are having problemsVasudhevan wrote:The above code done for including the Header.php file in the Home.php file is working in design time but not on runtime.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering