Thanks Miguel, I sort of figured I wasn't doing something right. Thanks for setting me straight on switching between html and php. Sort of basic, but I didn't know whether I needed to do that everytime.
Sorry for the delay in replying -- just as I received your message, we had company over. Regards, Andre On Friday 15 March 2002 19:41, you wrote: > On Fri, 15 Mar 2002, Andre Dubuc wrote: > > I'd like to control which php file is called when clicking two buttons on > > the bottom of a form; one called "Add Names", the other "Submit" > > > > I've tried the following with no success: > > > > ******************************************* > > <form action= > > switch ($name) { > > case add: > > "rap.php" method "get">; > > break; > > case submit: > > "rap2.php" method "get">; > > break; > > } > > > > . . . > > > > <input type="submit" name="add" value="Add Names"> > > <input type="submit" name="submit" value="Submit"> > > </form> > > > > ************** > > > > I'm still a newbie, and this is the first time I've tried to use a switch > > statement. I've probably performed an illegal operation by splitting the > > <form action . .> statement. > > Yup, you're not switching between HTML and PHP properly. Whenever you > switch between literal HTML code (which is processed by the browser at > the end of the transmission) and PHP code (which is processed by the > server before the transmission), you need to indicate this to the server. > > Try this: > > <form action="<? > switch ($name) > { > case add: > ?>rap.php<? > break; > case submit: > ?>rap2.php<? > break; > } > ?>" method="get"><input type="submit" name="add" value="Add Names"> > <input type="submit" name="submit" value="Submit"> > </form> > > Notice that all the PHP code is enclosed between <? and ?>. I switched > back and forth liberally (normally, for the sake of readability, I'd > probably do "print 'rap.php;'" instead of "?>rap.php<?") so you could see > how it's possible to switch more or less at any moment. > > miguel -- Please pray the Holy Rosary to end the holocaust of abortion. Remember in your prayers the suffering souls in Purgatory. May God bless you abundantly in His love! For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php