Hi I have a form and the action is submitting into a script named autoform.asp. In this script I usually request the fields values like this: txtFirstName = Request.Form(“txtFirstname”)
Now I want to make this to work dynamically without hard coding the requests in the script where the form is posting.
I managed to do this code to get the the form fields dynamically but they are not being loaded on the fly.
For Each Item In Request.Form
fieldName = Item
fieldValue = Request.Form(Item)
Response.Write(""& fieldName &" = Request.Form("""& fieldName &""")")
Next
The Response.Write is not good because it is stopping my script to continue. That said the values showing are correct. Can someone help me please? Maybe I need an array? and If yes how I can continue this process? THANKS
EDIT as per comment below
You can use the Execute statement to mimic import_request_variables from php
If you are intending to output
Firstname = Request.Form(“Firstname”)
then use
If you are intending to output
Firstname = “John”
then use