PHP - Loop through data fields submitted from form

liunx

Guest
Hi all,

I've been using ASP for ages now and decided it was time to get to grips with some PHP. Am very impressed so far.

Anyway... I know this is possible using ASP and would be disappointed if it isn't in PHP... perhaps someone can help.

I want to create a script that will loop through all the field names in a database once submitted and display the name and value for each in a list. Without having to write them all out manually.

Can anyone help me out?

Thanks,

Jonwhile (list($key,$value) = each($_POST)){
echo "Key: ".$key . "Value: ".$value."<br />";
}

that is one way, you can also use froeach() loop. this will print everything that was submited from a form to the screen.
 
Back
Top