I want to make an application that will be receiving get requests and respond with xml.
Here’s the scenario:
User comes to site_a.com?site.phpid=abc, from there I have to make a GET request to site_b.com/checker.php?id=abc.
How to make a GET request without user leaving the page?
Inside checker.php I have to respond with xml depending on that id
if(isset($_GET['id'])){
if($_GET['id']=='abc'){
// respond with xml
}
}
and then is site.php I have to receive that xml.
Thanks!
The easist way, you could use file_get_contents:
But make sure
allow_url_fopencan be true.http://php.net/manual/en/filesystem.configuration.php