Re: MULTIPLE SUBMIT BUTTONS

From: Date: Sat, 10 May 2003 17:00:43 +0000
Subject: Re: MULTIPLE SUBMIT BUTTONS
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147126@lists.php.net to get a copy of this message
Depends on what you name your buttons. Easiest way is to name all of them the same and assign different values and then check that var name on the next form. type=submit name=submit value=close type=submit name=submit value=new etc.. Next page, switch($_POST['submit']) { case "close": etc... HTH -Shawn "Dale" <DaleHersh@hotmail.com> wrote in message news:20030510165427.82269.qmail@pb1.pair.com... > Hi, > I have read the section in the online manual on how to access variables > outside of php, but I am still have problems with the current situation: > > I have a form that has multiple submit buttons: > > 1. save & close > 2. save & new > 3. save & redirect > 4. save > > Each of these buttons will need to call the same save function, but after > the data from the form has been saved, each button will have a unique task. > How do I access the name of the submit button in php. I have tried the > following methods: > > $_POST['SUBMIT'] > $SUBMIT > > and so far I have had no luck. I do have global variable turned on. > > Thanks, > Dale > >

« previous php.general (#147126) next »