I'm trying to make a web api that sends requests to other domains, but since AJAX can't do this alone, I found a PHP script using cURL that could:
But cURL isn't installed in x10hosting. Since cURL is just a library and not a service like mySQL, I was wondering if there was an alternative way of doing this using just PHP or maybe a library that is installed.
Code:
<?php
$url = $_GET["url"];
$session = curl_init($url);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$xml = curl_exec($session);
header("Content-Type: text/xml");
echo $xml;
curl_close($session);
?>
But cURL isn't installed in x10hosting. Since cURL is just a library and not a service like mySQL, I was wondering if there was an alternative way of doing this using just PHP or maybe a library that is installed.