RE: [PHP] Multipage form

From: Date: Wed, 20 Mar 2002 21:17:18 +0000
Subject: RE: [PHP] Multipage form
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-89407@lists.php.net to get a copy of this message
I find sessions to be the best solution in these situations. I like to compile the problem into a single multi-dimensional array of pages and form inputs such as.. $forms = array ( 'contact' => array ($company, $name, $email, $addr, $phone), 'creditcard' => array ($full_name, $num, $type, $confirm) ); session_register(forms); Access.. $forms[contact][0]; // $company $forms[creditcard][3]; // $cc_confirm This way there is no chance I can loose data. And there isn't anything that my visitors can do to mess it up. Set the No-cache headers at the top of each script to prevent the "page expired" message from appearing when your users hit the back button. You should also use the session array to repopulate fields. Do not rely on browser cache. header("Pragma: no-cache"); header("Cache-Control: no-cache"); -Kevin -----Original Message----- From: David Johansen [mailto:daveisfera@yahoo.com] Sent: Wednesday, March 20, 2002 9:57 AM To: php-general@lists.php.net Subject: [PHP] Multipage form I was just wondering what was the best way to handle a multipage form. Would the best way be to keep passing the variables through the forms as hidden values or should I use sessions and store all the values as session variables? What's the best way to handle all of this? Also the different forms will all be in the same php file that loops to itself if that makes a difference. Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#89407) next »