Hello all,
I have a form with an unknown number of text fields in it.
once submited i need my php script to get all those variables i.e. the text input names from the form.
is that possible or I have to specify each name one by one...?
Thanks
loop through all form elements
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you're using the $_POST array it's easy to deal with varying numbers of fields, for example:
Mac
Code: Select all
foreach ($_POST as $key => $value) {
echo 'Field name: <b>'.$key.'</b> and value: <b>'.$value.'</b><br />';
}