This is a discussion on Re: FORMS PHP within the alt.comp.lang.php forums, part of the PHP Programming Forums category; > I do have a simple form with sumbit button and action form is php script. > This script simply ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
> I do have a simple form with sumbit button and action form is php script.
> This script simply adds the customer to the mysql database. > > But, what if I would like to add another button to delete the customer. > How can I handle running to scripts on one form using two seperate buttons. In form: <INPUT TYPE="SUBMIT" NAME="work" VALUE="Add"> <INPUT TYPE="SUBMIT" NAME="work" VALUE="Delete"> In script: if ($work == 'Add'') { add to base } if ($work == 'Delete'') { delete from base } This works in my scripts :) Ofcourse use $_POST['work'] or $_GET['work'] instead of $work. -- Sarenka (ale facet) http://smiesznostki.prv.pl To live for perfect 10 minutes... |
|
|||
|
thanks a lot
it helped "Sarenka" <sarenka@bez.spamu.bo.nie.lubie.interia.pl> wrote in message news:bf9qfe$n9h$1@korweta.task.gda.pl... > > I do have a simple form with sumbit button and action form is php script. > > This script simply adds the customer to the mysql database. > > > > But, what if I would like to add another button to delete the customer. > > How can I handle running to scripts on one form using two seperate > buttons. > > In form: > <INPUT TYPE="SUBMIT" NAME="work" VALUE="Add"> > > <INPUT TYPE="SUBMIT" NAME="work" VALUE="Delete"> > > > > In script: > > if ($work == 'Add'') { > > add to base > > > } > > > > if ($work == 'Delete'') { > > delete from base > > > } > > > > This works in my scripts :) Ofcourse use $_POST['work'] or $_GET['work'] > instead of $work. > -- > Sarenka (ale facet) > http://smiesznostki.prv.pl > > To live for perfect 10 minutes... > |