I am trying to write a quick form->mail script (like Matt's) and I am stuck
on one small part:

form:
<form method=post action=form.php>
<input type=text name='field1'><br>
<input type=text name='field2'><br>
<input type=text name='field3'><br>
<input type=text name='field4'><br>
<input type=text name='field5'><br>
<input type=text name='field6'><br>
<input type=text name='field7'><br>
<input type=text name='field8'><br>
<input type=text name='field9'><br>
<input type=text name='field10'><br>
<input type=text name='field11'><br>
<input type=submit value='Go'>
</form>

Form.php (receiver of the form post):
foreach($_POST as $x) {
    print "$x<br>";
}


Will output the values of field1, field2, etc

BUT - how do I get the field names on the form.php page?  I want to be able
to display:
field1: value of field 1

But short of the form posting the field names as a separate field, how can I
just grab the posted field NAMES as well as their VALUES?

This may seem like a simple question, but I am too damn lazy to look through
thousands of previous emails for what may take someone a quick 5 min to
write it. :)

Thanks :)


--
Cheers

Mike Morton

****************************************************
*
*  E-Commerce for Small Business
*  http://www.dxstorm.com
*
* DXSTORM.COM
* 824 Winston Churchill Blvd,
* Oakville, ON, CA L6J 7X2
* Tel: 905-842-8262
* Fax: 905-842-3255
* Toll Free: 1-877-397-8676
*
****************************************************

"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to