steveosoule
11/20/2013 - 8:58 PM

Cross Domain AJAX Proxy for JavaScript

Cross Domain AJAX Proxy for JavaScript

<?php
// FROM: http://www.sitepoint.com/creating-mobile-html5-application-app-framework/
$url = $_GET["url"];
$ch = curl_init(); // Check that the php_curl extension is enabled in php.ini
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
echo $response;
curl_close($ch);
?>