DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Arthur has posted 13 posts at DZone. View Full User Profile

PHP: Pass On Values For A Multi-Page Form

  • submit to reddit
        While the best way to do this involves saving the data into a database and passing an encrypted reference to the next page, this method will suffice for non-critical uses.

foreach ($_POST as $field=>$value) {
	echo "<input type=\"hidden\" name=\"" . $field . "\" value=\"" . $value . "\" />";


Kenneth Mccall replied on Fri, 2007/08/10 - 11:56am

I've had to use that code before. It's quite nice. You can also load all the post's to the $_SESSION.