[ciapug] POST array and iterating through it

Chris Hettinger ciapug@cialug.org
Mon, 22 Dec 2003 10:27:41 -0600


I think I got it to work in my test,

$array =3D $_POST;

>> I got stuck for a moment unsure if I could do the above, brain fart.

foreach ($array as $key =3D> $value) {
   echo "Key: $key; Value: $value<br>\n";
}

OUTPUT

Key: formName; Value: custserv
Key: name; Value: Chris Hettinger
Key: email; Value: cjh@raccoon.com
Key: phone; Value: 515-205-5711
Key: ins_carrier; Value:=20
Key: comments; Value: Blah
Key: btn_submit; Value: Submit


I will now work on the formatting for the mail message.

-ch

-----Original Message-----
From: Chris Hettinger=20
Sent: Monday, December 22, 2003 10:17 AM
To: Ciapug (E-mail)
Subject: [ciapug] POST array and iterating through it


I am working on a quick script to handle emailing the results of input =
into a few forms.

Since the forms vary just a small bit in the number of form fields I =
would like to have my it, on submit, iterate through the $_POST array, =
and for each line include in the body of the message it's Key (name of =
the field) and the Value (input).

My question is how to best iterate through that array.

-Chris Hettinger, Web Specialist
-IFMC/ENCOMPASS
-www.encompas.com
-(515) 279-8730



CONFIDENTIALITY NOTICE:  This communication, including any attachment, =
may contain confidential information and is intended only for the =
individual or entity to whom it is addressed.  Any review, =
dissemination, or copying of this communication by anyone other than the =
intended recipient is strictly prohibited.  If you are not the intended =
recipient, please contact the sender by reply email, delete and destroy =
all copies of the original message.'

_______________________________________________
ciapug mailing list
ciapug@cialug.org
http://cialug.org/mailman/listinfo/ciapug


CONFIDENTIALITY NOTICE:  This communication, including any attachment, =
may contain confidential information and is intended only for the =
individual or entity to whom it is addressed.  Any review, =
dissemination, or copying of this communication by anyone other than the =
intended recipient is strictly prohibited.  If you are not the intended =
recipient, please contact the sender by reply email, delete and destroy =
all copies of the original message.'