View Full Version : Identifying the parameters in post strings

04-11-2003, 07:47 PM
If someone submits a form to blah.php, how can you identify the form names and parameters that have been posted, on that page ?

04-11-2003, 08:03 PM
foreach($_POST as $var=>$val)
echo 'form field named ' .$var. ' held value ' .$val. '<br />

04-11-2003, 11:30 PM
"form field named SubmitButton held value Go"

It doesn't display the stuff I typed into the form boxes...


04-11-2003, 11:36 PM
Ah never mind.

I search for $_POST and basically what I needed to do was echo '$blah' if the name of the input box was blah :)

04-12-2003, 06:20 AM
unless you have a real old version of PHP <4.1 - get used to using

$_POST['blah']; as opposed to $blah;

else one day it will bite you in the behind.

if Okii's code did not work it would be because your form fields were empty !