0

请帮忙,我有一个简单的网络表单,当按下提交按钮时,我希望表单将数据发布到两个 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>
4

1 回答 1

-1
  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();
}
于 2011-08-19T23:02:22.147 回答