Re: A _post question I guess

From: Date: Mon, 29 Sep 2003 15:49:04 +0000
Subject: Re: A _post question I guess
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-164258@lists.php.net to get a copy of this message
John Taylor-Johnston wrote:
I have a form. It has any number of hidden fields, named "exercise 1-100". Their names all start with "exercise" as in: <input type=hidden name=exercise1> ... ? <input type=hidden name=exercise11> any number fo these possible ... <input type=hidden name=exercise71> How can I create one scipt that will recognise all of them? Any number of them. My idea is a bit like formmail.pl that reads any old field and mails it. Mine will read any number of "exercise" fields.
You could just loop over the _POST array. foreach ($_POST as $field_name => $field_value) { $content .= "$field_name = $field_value\n"; } Then just email $content. You could filter out the excerciseN fields if you only wanted to send those. - Brad

« previous php.general (#164258) next »