search for name of form field

Go To StackoverFlow.com

-1

I need to grab for the name for a input field.

All of them start with inf_custom_InvitationCode and they have a number appended to the end of them.

inf_custom_InvitationCode0

inf_custom_InvitationCode1

and so on. They could be different depending on the form.

How can I search for this and grab the data?

2012-04-04 00:58
by Tom
What do you mean grab? Is this PHP code? What does print_r($_POST) look like - A B 2012-04-04 01:00
Well it was tagged as php was it not - Tom 2012-04-04 02:15


1

If the fields are named 'inf_custom_InvitationCode###' and you control the source of the data being submitted to your form, you may be better off changing the code that creates the client-side form to name the input fields 'inf_custom_InvitationCode[]' (all of them can use that same name). If you do this, PHP will take all the input values and add them as a single key to the $_REQUEST (and $_GET or $_POST)) array, which you can then use as you would any array.

Otherwise, you the PHP manual contains something that does something like what you want to use.

2012-04-04 01:08
by Ariel
Ads