Hello All,
I am trying to figure out how to do this: I have a script it right now its a two page form. when it first loads it loads the default form once the submit is hit it reloads it self and take the $POST and changes it over to $SESSION['FORM']['key']
then what I would like to happen is it load the next form, I am going to have 4 pages right now its only two. now once the sec form is displayed and they hit submit if they have the box check add another it should display the form and add a number to the $_SESSION for the previce submitted form. (in this case sec page is addresses) so if they have more then one address then they would check the box and hit next which would redisplay the same form and allow them to add another
could someone please help me figure this out, I been thinking about this for a while and only came up with what I have below:
<?php
session_start();
echo $_SESSION['FORM']['ms'];
if(isset($_SESSION['FORM']['submit']))
{
if($_SESSION['FORM']['submit'] == 'general')
{
foreach($_POST as $key => $value)
{
$_SESSION['FORM'][$key] = $value;
}
$form = 'general';
$form_name = $form;
// $form = 'address';
}
}
else
{
echo'
<form name="'. ( (isset( $form_name )) ? $form_name : 'general' ) .'" method="post" action="'. $_SERVER['PHP_SELF'] .'">';
switch($form = NULL)
{
default:
include( '/home/dev/www/query/general_form.php' );
break;
case 'address':
include( '/home/dev/www/query/address_form.php' );
break;
}
echo'
<center>
<input type="submit" value="Next Step" name="'. ( (isset( $form_name )) ? $form_name : 'general' ) .'">
</form>
';
}
?>
Thanks ahead of time!
Sincerely,
Christopher