This is a simple PHP script to automatically display (dump output) data submited from a html form.
The form setup
- all inputs (form fields) need to have the same name with [] at the end to turn it into an array, e.g <input type=text name=formdata[]>
formq.html content
<form method=post action=showme.php>
Name: <input type=text name=formdata[]><br>
Email: <input type=text name=formdata[]><br>
<input type=submit value=ok>
</form>
The Script setup
showme.php content
<?php
$data = $_POST['formdata']; # get value from the form fields
foreach ( $data as $key => $value ) { # loop through array collecting the results
echo “$value<br>”; # output the data – print to page
}
?>




