Skip to content

About

A lightweight PHP script to forward GET and POST requests, including JSON, to any target URL. Ideal for payment gateways and HTTP redirection.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Payment Gateway Forwarder

License: MIT

Payment Gateway Forwarder is a lightweight PHP script that forwards HTTP requests to a target URL. It supports both GET and POST requests, including JSON payloads, and can be used to simplify interactions with payment gateways or any external HTTP service.

This script handles:

  • GET requests by redirecting to the target URL.
  • POST requests with form data by automatically submitting an HTML form.
  • POST requests with JSON payloads by sending them directly via cURL.

Installation

  1. Clone this repository or download the index.php file:
git clone https://github.com/BaseMax/payment-gateway-forwarder.git
  1. Place index.php in your web server directory.

  2. Make sure your server supports PHP 7.4+ (or higher) and cURL.


Usage

Forward a GET request

GET /index.php?url=https%3A%2F%2Fexample.com%2Ftarget

This will redirect the client directly to the target URL.

Forward a POST request

  1. Form submission (application/x-www-form-urlencoded):

Send a POST request to index.php with a url parameter and any form fields. The script will generate a hidden HTML form and automatically submit it to the target.

  1. JSON submission (application/json):

Send a POST request with Content-Type: application/json:

curl -X POST "https://yourdomain.com/index.php?url=https%3A%2F%2Fexample.com%2Ftarget" \
     -H "Content-Type: application/json" \
     -d '{"amount":100,"currency":"USD"}'

The script will forward the JSON payload to the target URL and return the response with the correct HTTP status code.


Security Considerations

  • Ensure the url parameter is validated before use in production.
  • Avoid exposing this script publicly without access control to prevent misuse.
  • Only forward requests to trusted endpoints.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Author: Seyyed Ali Mohammadiyeh (Max Base)

License: MIT

Copyright: 2025

Happy forwarding! 🚀

About

A lightweight PHP script to forward GET and POST requests, including JSON, to any target URL. Ideal for payment gateways and HTTP redirection.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages