Portwolf Posted November 11, 2010 Share Posted November 11, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/218417-requesting-dynamic-form-names/ Share on other sites More sharing options...
DavidAM Posted November 11, 2010 Share Posted November 11, 2010 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 */ } Quote Link to comment https://forums.phpfreaks.com/topic/218417-requesting-dynamic-form-names/#findComment-1133154 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.