OK I've got this working and it creates the page and puts it to the hard drive. Here's beginning of the code:
<?
$fp = fopen("$members_link", "w");
fputs($fp, "<HTML><HEAD>");
fputs($fp, "<TITLE>npi_main_1</TITLE>");
fputs($fp, "<META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=iso-8859-1> ");
fputs($fp, "<link rel=stylesheet type=text/css href=npi.css>");
fputs($fp, "</HEAD>");
fputs($fp, "<BODY BGCOLOR=#FFFFFF topmargin=0 leftmargin=0>");......
The problem is at this point is, in the static page I made for this has (includes) which display data from the database, but the includes don't seem to be picking up the variables:
fputs($fp, "<? include('incl_chapter_members.php') ?>");
<?
include('dbconnect.php');
include('font_setting.htm');
$chapter = ($members_link);
Echo "Chapter = " . ($chapter);
Echo "Chapter_name = " . ($chapter_name);
$query = ("select * from tbl_members where chapter='$chapter_name'");
$result = mysql_query($query) or die("Query fail");
if (mysql_num_rows($result) == 0)
{
} else
{
echo "<CENTER>";
echo "<table border=1>";
while($row = mysql_fetch_array($result))
{
echo "<tr><td> " . " " . $row['name'] . " " . "</td><td> " . " " . $row['category'] ." " . "</td><td> " . " " . $row['phone'] . " " . "</td></tr>";
echo "</font>";
}
echo "</table>";
}
?>