Problem with registration form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wizzard81
Forum Commoner
Posts: 66
Joined: Wed Jan 15, 2003 6:05 am
Location: Belgium
Contact:

Problem with registration form

Post 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');
}
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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'] : "")."\">";
hongco
Forum Contributor
Posts: 186
Joined: Sun Feb 20, 2005 2:49 pm

Post by hongco »

use session for each variable holding info entered by user. if user needs to go back one step, echo those sessions.
Post Reply