The first thing you need to do is create a formpage.asp page with the code below:
Next, we create a resultspage.asp page and enter the code as seen below:
<% DIM objRS Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "YOUR table name HERE", objConn, , adLockOptimistic, adCmdTable objRS.AddNew objRS("Email") = Request.Form("Email") objRS("Name") = Request.Form("Name") objRS("Comments") = Request.Form("Comments") objRS.Update objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing %>
<% DIM strName strName = Request.Form("Name") Response.Write strName %>,
Thank you for emailing me.>
Now you have a complete form that sends data to database that you can refer to in the future. This is a great way to follow up with customers and track how many people are using your website from year to year.
http://www.aspwebpro.com/aspscripts/forms/formtodatabase.asp
No comments:
Post a Comment