Page 1 of 1

html post form question

Posted: Sun Sep 10, 2006 9:38 pm
by ianhull
Hi Guys,

A quick question.

Is it possible to retrieve the values of posted form fields if you do not know the name of the input or select box but you know the form name?

Code: Select all

<form id="form1" name="iknowthisname" method="post" action="">
</form>
Thanks in advance.

Posted: Sun Sep 10, 2006 9:51 pm
by feyd
The form name is not transmitted. You can look through the $_POST superglobal for the fields submitted.

Posted: Sun Sep 10, 2006 11:01 pm
by nickman013
Its not possible. To get the value, you need to know the name.

Posted: Mon Sep 11, 2006 12:16 am
by Todd_Z

Code: Select all

foreach ( $_POST as $key => $val )
  echo "<p>{$key}: {$val}</p>";