Link to home
Start Free TrialLog in
Avatar of chaduka
chaduka

asked on

Capturing All Variables

I need to capture all the variables from a POST submitted form. Take in mind that the fields in this form are unknown, that means the CFM template is a generic one. It's easy with GET submitted form because one can use CGI.QUERY_STRING and list manipulation functions. I can't seem to find an environment variable like CGI.QUERY_STRING to handle POST submitted forms. Help?
Avatar of OeilNoir
OeilNoir

can you post a part of your code?
ASKER CERTIFIED SOLUTION
Avatar of Nathan Stanford Sr
Nathan Stanford Sr
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chaduka

ASKER

Aaaaah, exactly what I am looking for.

Thanx a lot.
the line...

<cfset Value#form_element# = #Evaluate(FORM.fieldnames)#>

should be

<cfset Value#form_element# = #Evaluate(form_element)#>


Avatar of chaduka

ASKER

Thanx,

I preferred to do something like this:

       <cfset fieldNamesArray = ArrayNew(1)>
       <cfset fieldValuesArray = ArrayNew(1)>
       <cfset arrayIndex = 1>

       <cfset formFieldNamesArray = ListToArray(form.fieldnames, ",")>

       <cfloop index="fieldName" list="#form.fieldNames#">

        <cfset fieldNamesArray[arrayIndex] = #fieldName#>
        <cfset fieldValuesArray[arrayIndex] = #evaluate(fieldName)#>
        <cfset arrayIndex = IncrementValue(arrayIndex)>

       </cfloop>