EDITED QUESTION: I want to simulate two different applications. On the first (script X) a form can be submitted and gets handled by itself. He also is POSTing data to a second application (script Y) via REST.
Currently script Y is nothing more then:
<?php
if(isset($_POST)) {
deliver_response(200, "success", $_POST);
}
function deliver_response($status, $status_message, $data) {
header("HTTP/1.1 $status $status_message");
$response['status'] = $status;
$response['status_message'] = $status_message;
$response['data'] = $data;
$json_response = json_encode($response);
echo $json_response;
}
?>
So, when I submit script X, it is POSTing some data to script Y via REST, and above shows how script Y handles the POST request from script X. The echo is being displayed on the screen of script X, but I want to have a second screen with script Y where this echo is being displayed automatically at the moment it receives the POST request from script X.
I hope I made my point clear. Is this somehow possible that script Y just receives the POST request (maybe still sending 200 succes back), but also displays the data it received on it's own screen? If yes, could you give me a hint?
And no, I don't want for script Y to check every few seconds with a GET request if there was submitted some new data at script X.
Thanks in advance!