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
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
  */
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.