开发者

Redirect/POST Form Data to Site After Inputs are Validated in PHP

开发者 https://www.devze.com 2023-01-14 15:08 出处:网络
So I have a retreat registration form that is hooked 开发者_JAVA百科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

So I have a retreat registration form that is hooked 开发者_JAVA百科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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消