0

朋友们..!

我想在几秒钟后重定向到 paypal payflow 链接:

https://pilot-payflowlink.paypal.com/?MODE=TEST&SECURETOKENID=f976bec739fb40a5a0e48c1876d570e6&SECURETOKEN=7yVdfkdwbgkOzAg2h1vxHggvL

在联系表格中输入详细信息并单击发送然后显示电子邮件已成功发送等..as

联系表格处理器代码如下:

<?php
$cardlink = $_POST['cardlink'];
$howmuch = $_POST['howmuch'];
$name = $_POST['name'];
$email = $_POST['email'];
$address = $_POST['address'];
$phone = $_POST['phone'];
$website = $_POST['website'];
$comments = $_POST['comments'];
$formcontent="Card Image Link: $cardlink \n How much cards: $howmuch \n From: $name \n Email: $email \n Address: $address \n Phone: $phone \n Website: $website \n Additinal Informations: $comments";
$recipient = "nicefellow1234@gmail.com";
$subject = "Card Designig Order By : $name ";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
// Email has sent successfully, echo a success page.
 echo "<fieldset>";
 echo "<div id='success_page'>";
 echo "<h1>Email Sent Successfully.</h1>";
 echo "<p>Thank you <strong>$name</strong>, your message has been submitted to us.</p>";
 echo "</div>";
 echo "</fieldset>";
?>

实时联系表格位于此链接:http ://www.webngraphicssolutions.com/new_site/html_purple/web-contact-form-order-now/index.php

4

2 回答 2

0

提交表单后,您可以使用 javascript 重定向用户。

<script type="text/javascript">
  window.onload = function () {
    window.location.href = "https://pilot-payflowlink.paypal.com/?MODE=TEST&SECURETOKENID=f976bec739fb40a5a0e48c1876d570e6&SECURETOKEN=7yVdfkdwbgkOzAg2h1vxHggvL";
  };
</script>

在表单处理器发送的响应中输出上述代码。

编辑: 由于表单是基于 ajax 的,你想在 5 秒后重定向,这里是修改后的答案:

将以下代码放入您的 ajax 成功处理程序中。

window.setTimeout(function () {
  window.location.href = "https://pilot-payflowlink.paypal.com/?MODE=TEST&SECURETOKENID=f976bec739fb40a5a0e48c1876d570e6&SECURETOKEN=7yVdfkdwbgkOzAg2h1vxHggvL";
}, 5000);
于 2013-10-19T09:20:12.513 回答
-1

使用 setInterval 函数

setInterval(function(){
    // Do something every 2 seconds
}, 2000);
于 2013-10-19T09:46:45.240 回答