I'm writing a simple application. From C
I'm calling ReST API to server.php. In sever.php, once I get the request from C
I have to send some Data-X. This Data-X is sent by the javascript when user clicks a button. But I don't know how to get the Data-X from javscript.
GET
c ----> php | <--- JS
(waits (handling GET | (user clicked button
for request &waiting | and send data-X
responce) for Data-X to send) | to PHP)
server.php
<?php
...
case 'GET':
// Wait for JS.
// Now echo result
break;
?>
I searched few event listens in php. but I didn't get them. I don't know how to do it. Any help is appreciated.