Posted by onembk on 08/29/06 06:48
On 2006-08-24 11:57:46 -0600, axlq@spamcop.net (axlq) said:
>
> How do I create a form that two submit buttons, where each one
> submits the form input data to a different server?
It's not too hard. Have two submit buttons and then choose your action
based on which one was chosen.
==============================
form
==============================
<form action="handler.php" method="post">
Order form stuff
<input type="submit" name="invoice" value="Print invoice" />
<input type="submit" name="creditcard" value="Pay via credit card" />
</form>
==============================
handler.php
==============================
<?php
if (isset($_POST['invoice'])) {
Print an invoice
}
if (isset($_POST['creditcard'])) {
Pay via credit card
}
?>
If your using two different servers as your post suggests you can just
redirect the data to the correct location in the if() statement,
otherwise just add the appropriate code or include the appropriate file
in the if(). Hope that helps.
Navigation:
[Reply to this message]
|