1
Technical Help / Re: HTML topics
« on: Monday 29 May 06 10:53 BST (UK) »
Hi all,
With the first PHP example given I saw that a simple " ; " was missing. To include data in and existing file pulled from another file the following should work fine.
index.php example:
The yourdata.php will contain the data that you wish to include. This also could be any extension e.g yourdata.html.
The code you tried earlier was:
You can see that I have changed this to:
If yourdata.php is in the same folder as the index.php you can drop the path/to/ part. You can also drop it if you have a base href in you head section.
Hope that is of some help to you.
Kind regards.
With the first PHP example given I saw that a simple " ; " was missing. To include data in and existing file pulled from another file the following should work fine.
index.php example:
Code: [Select]
<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td>The data from your normal page in here.</td>
</tr>
<tr>
<td> <?php include ("path/to/yourdata.php"); ?> </td>
</tr>
<tr>
<td>The data from your normal page in here.</td>
</tr>
</table>
</body>
</html>
The yourdata.php will contain the data that you wish to include. This also could be any extension e.g yourdata.html.
The code you tried earlier was:
Code: [Select]
<? include "xxx.html" ?>
You can see that I have changed this to:
Code: [Select]
<?php include ("path/to/yourdata.php"); ?>
If yourdata.php is in the same folder as the index.php you can drop the path/to/ part. You can also drop it if you have a base href in you head section.
Hope that is of some help to you.
Kind regards.