curl - How do I simulate a POST request in PHP -
i working on script process credit cards , company process payments check user ip, country, etc of post request.
lets have following form:
<form method="post" action="http://payment-processing-company.com/process_payment.php"> <input type="text" name="card_holder" value="john doe"> <input type="text" name="creditcard_number" value="65415461171"> <input type="text" name="vcc" value="123"> <input type="text" name="exp_date" value="15/02/2017"> <input type="submit" value="send"> </form>
in above example user makes post action request directly http://payment-processing-company.com/process_payment.php process payment , payment-processing-company.com grab ip, country, etc.
what want simulate post request action="http://payment-processing-company.com/process_payment.php" in php file , when user press submit button simulate real ip, country.
please not recommend javascript/ajax submit. want hide action post action url source code , process when user press submit button in php file real ip, country, etc simulated in php
the quick way use curl
command
curl --data "card_holder=value1&creditcard_number=value2" http://payment-processing-company.com/process_payment.php
another way chrome extension such postman - rest client
Comments
Post a Comment