I have one application (checkpoint firewall)
That sends formats a URL from variables to form a request using the GET method
https://api.example.com/http/sendmsg?api_id=$APIID&user=
$USERNAME&password=$PASSWORD&to=$PHONE&text=$MESSAGE
how ever the website I want to use is a basic form using the POST method with the following source.
<html>
<form method="post">
Number:<input type="text" name="number"/><br/>
Message:<textarea cols="40" rows="4" name="message"></textarea><br/>
<input type="submit" value="send"/>
</form>
</html>
I can change the format of the URL as much as I like with in reason, as you can possible guess this is sending SMS text messages.
is there any way to format a URL with the POST method, or create an intermediate webpage that can translate the request?
thank you
EDIT
So this was the kind of thing I had in mind
$number = ($_GET["number"]);
$message = ($_GET["message"]);
//for testing the get method echo variables on screen
echo("Number: " . $number . "<br />");
echo("Message: " . $message . "<br />");
//use curl to post variables to second website
$vars = "number-" . $number . "&message=2 . message;
$ch = curl_init( '10.43.23.53' );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $vars);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec( $ch );
print_r(curl_getinfo($ch));
this script is hosted by a web site so application A can use its GET method to supply the variables, and the script will re-post them to application B via post. However it does not work and I don’t get any result from the response ?
1 Answer