tags:

views:

13

answers:

2

How can I print the name and values of a submitted form.

Thanks for any help.

+1  A: 
<?php    
print_r($_REQUEST)
?>
HoLyVieR
In PHP, $_REQUEST contains the data from $_GET, $_POST, and $_COOKIES, and the original poster asked for just $_POST.
HalfBrian
Actually your wrong, he asked for parameter in a form, by default parameter are passed in GET. This is why I put $_REQUEST instead of simply $_POST.
HoLyVieR
+1  A: 
foreach($_POST as $key => $val) {
  echo 'Name: '.$key."<br>\n";
  echo 'Value: '.$val."<br><br>\n";
}
Emil Vikström
Thank you, works a treat.
jpjones