stelogic
asked on
incrementation of saved files
thanks for takling the time to read this
is it possible to increment the saved txt file that frontpage can save form data as ?
thanks in advance
stelogic
is it possible to increment the saved txt file that frontpage can save form data as ?
thanks in advance
stelogic
Again..no..it overwrites everytime. You'd need to use a database of some sort and add new records to it with each form submission.
ASKER
can you give me an example or good link to an easy tutorial to do this please
Sure thing....can your server support ASP??
ASKER
yes it can
cheers
steve
cheers
steve
Great...that certainly makes life easier 8-)
You may want to check out www.asp101.com and get more code snippets and tutorials, but here is the basic idea.
First, you need a database, such as Microsoft Access. For our purposes here, we'll call it test.mdb
The database has a table called tblData with fields called Name and Comments.
We make a page called Form.asp
The code for that page is:
<%
set conn = server.createobject("adodb .connectio n")
conn.ConnectionString="Pro vider=Micr osoft.Jet. OLEDB.4.0; Data Source=" & Server.MapPath("../databas e/test.mdb ")&";"
conn.Open
sql = "SELECT * from tblData"
Set rs = Server.CreateObject("ADODB .Recordset ")
rs.Open sql, conn, 3, 3
addSQL = "INSERT INTO tblData (name, comments) VALUES ('" & request.form("name") & "','" & request.form("comments") & "')"
If (Request("Add") <>"") Then
conn.execute addSQL
response.write "Your comments have been added! Thank You!"
End If
%>
<form method="POST" action="Form.asp" name="FormSubmission">
<table>
<tr>
<td width="83%" bgcolor="#FFFFFF<font face="Arial">Add Your Comments Here:</font></a></td>
<td width="17%" align="center" bgcolor="#FFFFFF"> </ td>
</tr>
<tr>
<td width="83%" bgcolor="#FFFFFF" valign="top">
<p><font face="Arial"><b>Your Name:<br>
</b><input type="text" name="Name" size="59"></font></p>
<p><font face="Arial"><b>Comments:< br>
</b> <textarea rows="10" name="Comments" cols="47"></textarea></fon t></td>
<td width="17%" align="center" bgcolor="#FFFFFF" valign="bottom"><input type="submit" value="Add New" name="Add"></td>
</tr></table>
</form>
<%rs.close
conn.close
%>
I just wrote this off the top of my head, so typos may create errors. In any case, you get the idea..I hope.
You may want to check out www.asp101.com and get more code snippets and tutorials, but here is the basic idea.
First, you need a database, such as Microsoft Access. For our purposes here, we'll call it test.mdb
The database has a table called tblData with fields called Name and Comments.
We make a page called Form.asp
The code for that page is:
<%
set conn = server.createobject("adodb
conn.ConnectionString="Pro
conn.Open
sql = "SELECT * from tblData"
Set rs = Server.CreateObject("ADODB
rs.Open sql, conn, 3, 3
addSQL = "INSERT INTO tblData (name, comments) VALUES ('" & request.form("name") & "','" & request.form("comments") & "')"
If (Request("Add") <>"") Then
conn.execute addSQL
response.write "Your comments have been added! Thank You!"
End If
%>
<form method="POST" action="Form.asp" name="FormSubmission">
<table>
<tr>
<td width="83%" bgcolor="#FFFFFF<font face="Arial">Add Your Comments Here:</font></a></td>
<td width="17%" align="center" bgcolor="#FFFFFF"> </
</tr>
<tr>
<td width="83%" bgcolor="#FFFFFF" valign="top">
<p><font face="Arial"><b>Your Name:<br>
</b><input type="text" name="Name" size="59"></font></p>
<p><font face="Arial"><b>Comments:<
</b> <textarea rows="10" name="Comments" cols="47"></textarea></fon
<td width="17%" align="center" bgcolor="#FFFFFF" valign="bottom"><input type="submit" value="Add New" name="Add"></td>
</tr></table>
</form>
<%rs.close
conn.close
%>
I just wrote this off the top of my head, so typos may create errors. In any case, you get the idea..I hope.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
not really but i am still messing about with it .. but only get a few hours here and there so bear with me ..
cheers
steve
cheers
steve
Please let me know what parts you are having difficulty with.
stelogic...how's the ASP going??
ASKER
sorted ... thanks for the help
stelogic
stelogic
NP...cu next time. Thanks for the points!