使用http get将表单数据发送到两个url


Post form data to two urls using http get

请帮助,我有一个简单的web表单,当提交按钮被按下时,我希望表单将数据发布到两个url,同时立即重定向到其中一个。

这是我在表单提交后在php重定向页面上设置的。我如何添加第二个URL并成功重定向到其中一个?

<? $aff = $_GET['aff'] ; $click_id = $_GET['click_id'] ; $email = $_GET['from']; $fname = $_GET['name_(awf_first)']; $lname = $_GET['name_(awf_last)']; $zipcode = $_GET['custom_zipcode']; $address = $_GET['custom_address']; $phone = $_GET['custom_phone_number']; $state = $_GET['custom_state']; $city = $_GET['custom_city']; $subid = $_GET['meta_adtracking'] ; $cblink = $_GET['cblink']; $keyword = $_GET['keyword'] ; $keyword = eregi_replace('[^a-z0-9 ]', '2', $keyword); ?> <META HTTP-EQUIV="refresh" CONTENT=0;URL="http://ian.smileymedia.com/r2/?placementID=shopper&email=<?print $email?>&fname=<?print $fname?>&lname=<?print $lname?>&state=<?print $state?>&zip=<?print $zipcode?>&hphone=<?print $phone?>&mphone=<?print $phone?>&country=US&pubSubID=<?print $subid?>&city=<?print $city?>&addr=<?print $address?>">
<html>
<body>
</body></html>
  1. 为提交事件添加处理程序。
  2. 使用AJAX向第一个url发送数据。
  3. 使用form.submit()等标准方法发送数据到主url;

试着这样写:

<form onsubmit="submit();return false;">
.....
</form>
javascript:

function submit()
{
 var form = document.getElementById('formName');
 using ajax - see http://en.wikipedia.org/wiki/XMLHttpRequest
 return form.submit();
}