Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » PHP: How to save data for multi-page forms?
Closed Thread
Old 04-27-2009, 01:06 AM   #1 (permalink)
 
Super Techie

Join Date: Oct 2004

Posts: 384

Mr. tech is on a distinguished road

Default PHP: How to save data for multi-page forms?

What is the best way to save data from a multi-page form? Can I create a session and an array? E.g:

PHP Code:
$_SESSION['form_data'] = array();

$_SESSION['form_data']['page_1'] = array();
$_SESSION['form_data']['page_2'] = array();

$_SESSION['form_data']['page_1']['field_1'] = $_POST['field_1'];
$_SESSION['form_data']['page_1']['field_2'] = $_POST['field_2'];
$_SESSION['form_data']['page_1']['field_3'] = $_POST['field_2'];

$_SESSION['form_data']['page_2']['field_1'] = $_POST['field_1'];
$_SESSION['form_data']['page_1']['field_2'] = $_POST['field_2']; 
Or is it better to store it in a MySQL Database? Or what other way would you recommend?
Mr. tech is offline  
Old 04-27-2009, 01:41 AM   #2 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: PHP: How to save data for multi-page forms?

If it is sensitive data then a database is much more secure.

Otherwise, that way should work fine.
__________________

Need website help? PM me!
CrazeD is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Guide to Installing Apache, PHP, MySQL, and PHPMyAdmin on Windows CrazeD Programming Discussions 17 06-17-2009 04:27 PM
Calling all PHP and MySql experts murdocsvan Programming Discussions 4 04-17-2008 01:51 PM
Posting Form data to HTML page kizzeith Programming Discussions 15 02-03-2008 06:54 AM
Possible to save linux data on windows? darsunt Linux, BSD, other *nixes & Open Source Software 1 07-07-2007 05:10 AM