multiple stage, self processing forms in a single file
Posted: Mon Jun 02, 2003 3:37 pm
i guess i'll start witha hello and a short explanation of why i'm here.
hi everyone. i'm the coder for a site in the works. two friends of mine are doing graphics, i'm doing code. i'm hoping to use the site as a way to get around the catch-22 i experienced when trying to get internships in college (see my signature).
right now i'm trying to get everything working without the database (ie: no memory on the site) so that i know the php is working and just needs modification. the problem is that my forms refuse to work correctly. i have 4 stages i want to roll thgrough, eeach one checking the one before it was done, or sending the user back to the previous one with the errors shown.
my problem is that it's not displaying correctly. my code looks something like:
obviously i have actual working pages set up, but the combined page for all of this displays the first part and part of 2 and 3 telling me it cannot find things that are not set because that stage has not been gotten to yet.
i don't understand why it's even moving beyond the first page the first time.
hi everyone. i'm the coder for a site in the works. two friends of mine are doing graphics, i'm doing code. i'm hoping to use the site as a way to get around the catch-22 i experienced when trying to get internships in college (see my signature).
right now i'm trying to get everything working without the database (ie: no memory on the site) so that i know the php is working and just needs modification. the problem is that my forms refuse to work correctly. i have 4 stages i want to roll thgrough, eeach one checking the one before it was done, or sending the user back to the previous one with the errors shown.
my problem is that it's not displaying correctly. my code looks something like:
Code: Select all
if(isset($stage)&&($stage=='2')){
/* check for errors in the previous stage. if found set $stage to previous stage and $errors to errors found */
}elseif(isset($stage)&&($stage=='3')){
/* check for errors in the previous stage. if found set $stage to previous stage and $errors to errors found */
}
if(isset($stage)&&($stage=='1')&&($error==NULL)){
/* display page one */
}elseif(isset($stage)&&($stage=='1')&&($error!=NULL)){
/* display page one with errors */
}elseif(isset($stage)&&($stage=='2')&&($error==NULL)){
/* display page two */
}elseif(isset($stage)&&($stage=='2')&&($error!=NULL)){
/* display page 2 with errors */
}elseif(isset($stage)&&($stage=='3')&&($error==NULL)){
/* display page three */
}else{
/* display general error */
}i don't understand why it's even moving beyond the first page the first time.