Jump to content

Requesting Dynamic form Names


Portwolf

Recommended Posts

Ok so I am writing a CMS to wrap around a company script I wrote a while back. I am having trouble requesting dynamic form names.

 

Heres the code to generate the input fields:

 

        $fields		= mysql_result($result,$i,"fields");
$exFields       = explode(",", $fields);

for($i = 0; $i < count($exFields); $i++){
       echo "$exFields[$i] : <input type=\"text\" name=\"$exFields[$i]\"> <br>";
        }

 

Ok so it generates the fields the way I want. (design crap will be done later)

 

But I am having issues on processing the form, for example:

 

Fields get generated -> Client Fills them in -> Submitted into our already built function. The function takes those form values and creates an XDF file with the correct requested values.

 

But like I said I am having issues requesting the form values because they wont be static they will differ depending on each PDF.

 

Can anyone point me in the direction on how to get the form values?

Link to comment
https://forums.phpfreaks.com/topic/218417-requesting-dynamic-form-names/
Share on other sites

Assuming you use POST

 

foreach ($_POST as $fieldName => $fieldValue) {
  /* PROCESSING 
      $fieldName is the dynamically generated name of the field
      $fieldValue is the user entered value

      WATCH OUT, the button you use to submit the form will be here as well
  */
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.