What is the best way to save data from a multi-page form? Can I create a session and an array? E.g:
Or is it better to store it in a MySQL Database? Or what other way would you recommend?
PHP:
$_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?