PDA

View Full Version : create a html file with one line of text in it



andrewsheldon98
07-18-2002, 03:09 AM
how can i get a cgi script to create a html file with:

1. by using a result from a form to create the filename
2. by adding these lines below into the new created html document

<HTML>
<HEAD>
</HEAD>
<BODY leftMargin=0 topMargin=0 link="#000080" vlink="#000080" alink="#000080" bgcolor="#CCFF99">
<table border="1" cellpadding="0" cellspacing="0" width="100%" height="100%" bordercolor="#000000" bgcolor="#CCFF99">
<tr>
<td width="100%" valign="top">
&nbsp;
<div align="center">
<table border="0" cellpadding="3" width="400" background="../topmenu.gif" height="30">
<tr>
<td>
<p align="center"><font color="#FFFFFF" size="2" face="Arial"><b>General Pool</b></font></td>
</tr>
</table>
</div>
&nbsp;
<div align="center">
<TABLE cellSpacing=0 cellPadding=0 border=1 width="440" bordercolor="#555576">
<TBODY>
<tr>
<TD bgColor=#000000 width="317">
<p align="left">
<font color="#ffffff" face="Verdana" size="1">
<b>Post&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="postnewtopic1.htm">
<img border="0" src="postnew.gif"></a></b></font></p>
</TD>
<TD bgColor=#000000 width="123">
<p align="left">
<font color="#ffffff" face="Verdana" size="1">
<b>Poster</b></font></p>
</TD>
</tr>

Benahimvp
07-18-2002, 08:01 AM
Read this tutorial on writing to files (http://www.pageresource.com/cgirec/ptut16.htm). It should show you how it's done. And just so you know, if you write to a file that doesn't exist yet, it creates a new file with the information you insert.