在 PHP 中验证输入后将表单数据重定向/POST 到站点

发布于 2024-09-17 19:25:25 字数 625 浏览 0 评论 0原文

所以我有一个连接到 PayPal 的一份静修登记表。现在,在将其连接到 PayPal 之前,我在 PHP 中设置了代码来检查每个字段是否有效并正确清理它们。之后,它会将这个人添加到数据库中。

现在,我想要发生的是将用户重定向到 PayPal 支付页面,同时发送所有 POST 信息。问题是我不知道该怎么做。

到目前为止,我的边界是形式的动作。如果我希望验证/清理所有字段并将用户放入我的数据库中,我会将表单的操作设置为本地 register.php。如果我希望我的用户实际上被发送到 PayPal,他的信息也通过 POST 传送,那么我将表单的操作设置为 https://www.sandbox.paypal.com/cgi-bin/webscr (仍在 PayPal 沙箱中。)

有没有办法可以将表单的操作设置为 register.php,然后将 POST 信息发送到 https://www.sandbox。 paypal.com/cgi-bin/webscr

So I have a retreat registration form that is hooked up to PayPal. Now, before I hooked it up to PayPal, I setup code in PHP to go through and check if each field was valid and sanitize them properly. After that, it would add this person to a database.

Now, what I wanted to happen after that is for it to redirect the user to the PayPal paying page, sending along all the POST information as well. Problem is I have no clue how to do that.

So far, my boundary is the form's action. If I want all the fields to be validated/sanitized and have the user put into my database, I set the form's action to the local register.php. If I want my user to actually be sent to PayPal where his information gets carried along aswell via POST then I set the form's action to https://www.sandbox.paypal.com/cgi-bin/webscr (Still in the PayPal sandbox.)

Is there a way that I can have the form's action set to register.php and then send the POST information to https://www.sandbox.paypal.com/cgi-bin/webscr?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一影成城 2024-09-24 19:25:25

在保存信息的页面上,显示“请稍候...”消息,然后创建一个隐藏表单,其操作指向 paypal url,通过 php 将所有字段放入其中,使它们隐藏并使用 javascript 发布表单自动到贝宝。

On the page you save your information, show a "please wait ... " message, then create a hidden form with action pointed to paypal url , via php put in all the fields in it , make them hidden and using javascript post the form automatically to paypal.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文