Page 1 of 1

Problem with registration form

Posted: Tue May 17, 2005 3:47 pm
by wizzard81
Hello i'm having a problem with my registration form. I work in different steps but at the last step when i check if the customer is already in the database table stored i give an error that they are already a customer and they have to go back a step.

But then if they go back a step the page is empty. It's like the previous page is not saved. Any suggestions when working in steps?

My code can be found below.

Code: Select all

switch ($_POSTї&quote;step&quote;]){
    case 2:
        include ('advertise_step2.php');
        break;
    case 3;
        include ('advertise_step3.php');
        break;
    case 4:
        include ('inc/func_images.php');
        include ('advertise_step4.php');
        break;
    case 5:
        include ('advertise_step5.php');
        break;
    default:
        include ('advertise_step1.php');
}

Posted: Tue May 17, 2005 4:21 pm
by Burrito
well w/o seeing the code for the form page, there's not a whole lot I can tell you. If you're just including it again with $_POST['step'], then of course it's going to lose its values.

you should check to see if the post vars are set, and then enter them in the value attribute of the inputs.

ex:

Code: Select all

echo "<input type=\"text\" name=\"var1\" value=\"".(isset($_POST['var1']) ? $_POST['var1'] : "")."\">";

Posted: Tue May 17, 2005 5:45 pm
by hongco
use session for each variable holding info entered by user. if user needs to go back one step, echo those sessions.