You are here: Re: Two different POST actions? Possible? « PHP Programming Language « IT news, forums, messages
Re: Two different POST actions? Possible?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация