Your code is essentially correct, so just delete Response.Write
and do something else with the fieldName
and fieldValue
variables that you populate. After you finish working with the data (either insert them into the database or send an email), you can redirect the user to the success / thanks page.
To verify that you are getting the correct input, you can change Response.Write
to
Response.Write fieldName & " = " & fieldValue & "<br>"
Update
Here you can use the Dictionary object to combine field and field names:
Dim Item, fieldName, fieldValue Dim a, b, c, d Set d = Server.CreateObject("Scripting.Dictionary") For Each Item In Request.Form fieldName = Item fieldValue = Request.Form(Item) d.Add fieldName, fieldValue Next ' Rest of the code is for going through the Dictionary a = d.Keys ' Field names ' b = d.Items ' Field values ' For c = 0 To d.Count - 1 Response.Write a(c) & " = " & b(c) Response.Write "<br>" Next
stealthyninja
source share