How To List All Values of Submitted Fields


How To List All Values of Submitted Fields? - PHP Script Tips - Processing Web Forms



If you want list all values of submitted fields, you can write a simple loop to retrieve all entries in the $_REQUEST array. Below is an improved version of processing_forms.php to list all submited input values:

  $count = count($_REQUEST);
  print("Number of values: $count\n");
  foreach ($_REQUEST as $key=>$value) {
    print("  $key = $value\n");

If you test this with submit_comments.php on your Web server, you will get something like:

Number of values: 2
  name = Fyi Center
  comment = Good job.

2007-04-23, 6534👍, 0💬