Re: [PHP] Multi-Step Script
on 14.03.2001 5:59 Uhr, Andrew V. Romero at [EMAIL PROTECTED] wrote: Is it possible to use different parts of one php script for multiple html forms? I am not seeing how people create multiple pages of html forms with each form importing information from the previous form. Right now, for each html form page I have, I create one php script to handle it but it would be nice to have just one php script in which only certain parts execute depending on have variables have assignments. One way I was thinking of doing this is to have the html forms just keep posting the information to itself whenever the submit button is hit and then using a series of if else statements to evaluate where the program is in relationship to the forms, would this type of system work? What do you guys do? -Andrew V. Romero To reply personally, remove all numbers from address. Like some mentioned, reverse-programming is kinda crucial for error checking. About FORMS, yes you can have multiple forms aslong as the dont mismatch, you can even assign names to the forms for them to remain distinct. like form name=bla . I think it might even be possible to get that formname and then see what you do with each form. The other way round with if statements or switches works well though. Jens Nedal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Multi-Step Script
Is it possible to use different parts of one php script for multiple html forms? I am not seeing how people create multiple pages of html forms with each form importing information from the previous form. Right now, for each html form page I have, I create one php script to handle it but it would be nice to have just one php script in which only certain parts execute depending on have variables have assignments. One way I was thinking of doing this is to have the html forms just keep posting the information to itself whenever the submit button is hit and then using a series of if else statements to evaluate where the program is in relationship to the forms, would this type of system work? What do you guys do? -Andrew V. Romero To reply personally, remove all numbers from address. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Multi-Step Script
Use switch with includes for each step. switch() { case 1: include(filestep1.php) break; case 2: include(filestep2.php) break; default: include(form.php) } but this way you can have a hierarchy and possibly run form one section into the next.. switch($step) { case 1: include(filestep1.php) //list products case 2: include(filestep2.php) //list categories break; default: include(form.php) //show list of options. } At 09:59 PM 3/13/01 -0700, you wrote: Is it possible to use different parts of one php script for multiple html forms? I am not seeing how people create multiple pages of html forms with each form importing information from the previous form. Right now, for each html form page I have, I create one php script to handle it but it would be nice to have just one php script in which only certain parts execute depending on have variables have assignments. One way I was thinking of doing this is to have the html forms just keep posting the information to itself whenever the submit button is hit and then using a series of if else statements to evaluate where the program is in relationship to the forms, would this type of system work? What do you guys do? -Andrew V. Romero To reply personally, remove all numbers from address. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ## -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Multi-Step Script
On Wed, 14 Mar 2001 15:29, Andrew V. Romero wrote: Is it possible to use different parts of one php script for multiple html forms? I am not seeing how people create multiple pages of html forms with each form importing information from the previous form. Right now, for each html form page I have, I create one php script to handle it but it would be nice to have just one php script in which only certain parts execute depending on have variables have assignments. One way I was thinking of doing this is to have the html forms just keep posting the information to itself whenever the submit button is hit and then using a series of if else statements to evaluate where the program is in relationship to the forms, would this type of system work? What do you guys do? Mmm, that's pretty much how I do it. You can dynamically assign values to the Submit button as required and check the value of the Submit variable to determine what your next action might be. Couple this with some includes also based on the Submit value and voila. -- David Robley| WEBMASTER Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet| http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
FW: [PHP] Multi-Step Script
use if statements if( $submit ){ print "I love Montana"; put form #2 in here w/ action = $PHP_SELF make sure you set $submit2 to some value ) elseif( $submit2 ){ print "Part two of script"; } else{ put your form in here w/ action= $PHP_SELF } This is a quicky but hopefully you get the idea. Just assign values to different variables. Post the info back to $PHP_SELF and test for the existence of those variables in your if statements. Your single php script could span an unlimited number of pages (as far as the end user is concerned). Kevin Leavell [EMAIL PROTECTED] P 406.829.8989 C 406.240.4595 --- -Original Message- --- From: Andrew V. Romero [mailto:[EMAIL PROTECTED]] --- Sent: Tuesday, March 13, 2001 9:59 PM --- To: [EMAIL PROTECTED] --- Subject: [PHP] Multi-Step Script --- --- --- Is it possible to use different parts of one php script for multiple --- html forms? I am not seeing how people create multiple pages of html --- forms with each form importing information from the previous form. --- Right now, for each html form page I have, I create one php script to --- handle it but it would be nice to have just one php script in --- which only --- certain parts execute depending on have variables have --- assignments. One --- way I was thinking of doing this is to have the html forms just keep --- posting the information to itself whenever the submit button is hit and --- then using a series of if else statements to evaluate where the program --- is in relationship to the forms, would this type of system work? --- What do you guys do? --- -Andrew V. Romero --- To reply personally, remove all numbers from address. --- --- --- -- --- PHP General Mailing List (http://www.php.net/) --- To unsubscribe, e-mail: [EMAIL PROTECTED] --- For additional commands, e-mail: [EMAIL PROTECTED] --- To contact the list administrators, e-mail: --- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Multi-Step Script
if( $submit ){ print "I love Montana"; put form #2 in here w/ action = $PHP_SELF make sure you set $submit2 to some value ) elseif( $submit2 ){ print "Part two of script"; } else{ put your form in here w/ action= $PHP_SELF } Actually - do it in the reverse order, because then you can do error checking and gracefully "drop back" to a previous step if there's an error. ie: if ($step == 3) { // do stuff } if ($step == 2) { // do stuff } if (!$step) { // do stuff } Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Multi-Step Script
Good point Kevin Leavell [EMAIL PROTECTED] P 406.829.8989 C 406.240.4595 --- -Original Message- --- From: Jason Murray [mailto:[EMAIL PROTECTED]] --- Sent: Tuesday, March 13, 2001 11:59 PM --- To: 'Leavell Digital Design'; [EMAIL PROTECTED] --- Subject: RE: [PHP] Multi-Step Script --- --- --- if( $submit ){ --- print "I love Montana"; --- put form #2 in here w/ action = $PHP_SELF make sure you --- set $submit2 to --- some value --- ) --- elseif( $submit2 ){ --- print "Part two of script"; --- } --- else{ --- put your form in here w/ action= $PHP_SELF --- } --- --- Actually - do it in the reverse order, because then you can do error --- checking and gracefully "drop back" to a previous step if there's an --- error. --- --- ie: --- --- if ($step == 3) --- { --- // do stuff --- } --- if ($step == 2) --- { --- // do stuff --- } --- if (!$step) --- { --- // do stuff --- } --- --- Jason --- --- -- --- PHP General Mailing List (http://www.php.net/) --- To unsubscribe, e-mail: [EMAIL PROTECTED] --- For additional commands, e-mail: [EMAIL PROTECTED] --- To contact the list administrators, e-mail: --- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]