Re: A _post question I guess
| From: | Tom Rogers | Date: | Mon, 29 Sep 2003 15:49:33 +0000 |
| Subject: | Re: A _post question I guess | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164259@lists.php.net to get a copy of this message | ||
Hi,
Tuesday, September 30, 2003, 1:41:11 AM, you wrote:
JTJ> I have a form. It has any number of hidden fields, named "exercise
JTJ> 1-100". Their names all start with "exercise" as in:
JTJ> <input type=hidden name=exercise1>
JTJ> ... ?
JTJ> <input type=hidden name=exercise11>
JTJ> any number fo these possible ...
JTJ> <input type=hidden name=exercise71>
JTJ> How can I create one scipt that will recognise all of them? Any
JTJ> number of them. My idea is a bit like formmail.pl that reads any old field
JTJ> and mails it. Mine will read any number of "exercise" fields.
JTJ> John
name them as name="exercise[1]"
then do
if(isset($_POST['exercise'])){
foreach($_POST['exercise'] as $key=>$val){
echo 'Key '.$key.' val '.$val.'<br>';
}
}
--
regards,
Tom