I am trying to receive a cURL POST from another server, process the post in a script and give a response back by doing another cURL post to a website, according to a URL contained in the first POST. But I have no idea how to accept a cURL post in a PHP script.
Is it like:
if (isset($_POST['test'])){
//execute some code
}
So Website 45661 posts to Server 1 and the script on Server 1 see it’s Website 45661 and posts back to it via cURL.
Thanks
Welcome to SO!
Your code is a start. FYI, it doesn’t matter how your script is called, be it through curl, form submission, etc, so long as a post parameter called test is sent.
You could complete the code like so:
It is much easier to deliver data to the one requesting your script with json than posting something back with curl. That way, you don’t need to check who actually called your script, and it is also easier for testing, since the json object feedback will be shown in your browser.