Redirecting and Sending Data via POST in PHP
The scenario involves the need to submit an HTML form with hidden fields to an online gateway through a PHP script, despite the absence of any HTML forms. The question arises regarding how to accomplish this using POST data transfer, as opposed to the GET method, which is demonstrated in the example provided.
Answer
Unfortunately, it is not possible to directly redirect and send data via POST using PHP alone. Unlike GET, which allows data to be appended to the target URL, POST data transmission requires an actual form submission.
Alternatives
Form Generation and JavaScript Submission:
The above is the detailed content of How to Redirect and Send Data via POST in PHP Without an HTML Form?. For more information, please follow other related articles on the PHP Chinese website!