I know how to write to a text file, but how do I use a template so it is in html.
This is what I'm using to output the directory list on the fly.
Code: Select all
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if($file == '.' || $file == '..' || $file == 'images')
{
continue;
}
if(is_dir($file))
{
//display template
$name = strtoupper($file);
$thumb = strtolower($file);
include "template.php";
echo "<br>";
}
}
closedir($handle);
}
?>Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="template.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="415" height="155" border="0" class="cell">
<tr>
<td width="36%" height="149" align="left" valign="middle">
<div align="center"> <?php echo "<img src="images/thumbs/$thumb.jpg">"; ?> <br>
<font color="#333333"><strong> <?php echo $name ; ?> </strong></font></div></td>
<td width="64%"><div align="center">
<table width="75%" height="51" border="0" Class="dash">
<tr>
<td height="20" colspan="4"> <div align="center"></div>
<div align="center">
<p><font color="#666666" size="-1" face="arial"><strong>Download
ZIP Files Below</strong></font></p>
</div></td>
</tr>
<tr>
<td width="9%"><div align="center"></div></td>
<td width="41%"><div align="center"><font size="-1" face="arial"><? echo "<a href="$file/video">Videos</a>" ?></font></div></td>
<td width="41%"><div align="center"><font size="-1" face="arial"><? echo "<a href="$file/pics">Photos</a>" ?></font></div></td>
<td width="9%">&nbsp;</td>
</tr>
</table>
</div></td>
</tr>
</table>
</body>
</html>Any help would be great!
TIA,
Wes/