just name the submit: input type="submit" name="credit_card" and input type="submit" name="dealer" that's easy to capture. -alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: [EMAIL PROTECTED] ("Cal Evans") > Newsgroups: php.general > Date: 5 Jan 2001 09:09:03 -0800 > Subject: RE: [PHP] two submit buttons possible? > > I'd use JavaScript and the onSubmit() of the form to redirect the action of > the form based on the button pressed. > > Cal > > -----Original Message----- > From: Geoff Coffey [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 05, 2001 10:45 AM > To: PHP General > Subject: Re: [PHP] two submit buttons possible? > > > on 1/5/01 9:37 AM, Tom Beidler at [EMAIL PROTECTED] wrote: > >> I'm wondering if there is a way in PHP to have two submit buttons on a > form. >> One directs to one page, the other to another page. >> >> I have a checkout process that has two options, one for credit card users >> that needs to be secure, the other uses a dealer id which doesn't need to > be >> secure. >> >> The ISP we are working with can't get SSL and PHP on the same daemon. Most >> orders do not be secure so I can use PHP to fill in most of the form for >> them using PHP and MySQL. If they need to be secure I can't use PHP and >> there by cannot fill out the form ( unless there is some way to pass the >> variables from a PHP page to a vanilla html page?). >> >> Any assistance would be greatly appreciated. > > With javascript, you could have the buttons submit one of two hidden forms, > each of which goes to a different php script (action=...)...but there's > probably a better way. > > Just put two submit buttons on your form with different values (labels) and > the same name. On the PHP side, you can check which button was clicked > because it's value will be the value of the variable associated with the > submit button...does that make sense? Submit buttons are kind of like > one-shot radio buttons...the one you click sends it's value back with the > form... > > Hope this helps, > > Geoff > > > -- > 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] > -- 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]