The response is then exposed as an application internal resource, that can be easily queried by Ajax functions. - Christian Fröhlingsdorf, 14.04.2015 EWT ICT Bachelor */ if (!isset($_POST["proxy"])) { err("You have not set an action, POST parameter 'proxy' missing!"); } if (!isset($_POST["delivery"])) { $_POST["delivery"] = ""; } //set to empty string //callback (anon func PHP 5.0) $cb = function ($res) { pri($res); }; do_curl_post_request("http://localhost:3536", $_POST["proxy"], $_POST["delivery"], $cb); //main curl function function do_curl_get_request($url, $proxy, $delivery, $callback) { $curl = curl_init(); if (!is_string($proxy)) { $proxy = json_encode($proxy); } if (!is_string($delivery)) { $delivery = json_encode($delivery); } //build the query string $url .= "?proxy=" . urlencode($proxy) . "&delivery=" . urlencode($delivery); curl_setopt_array($curl, array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => 1)); $response = curl_exec($curl); if (!$response) {
The response is then exposed as an application internal resource, that can be easily queried by Ajax functions. - Christian Fröhlingsdorf, 14.04.2015 EWT ICT Bachelor */ if (!isset($_POST["proxy"])) { err("You have not set an action, POST parameter 'proxy' missing!"); } if (!isset($_POST["delivery"])) { $_POST["delivery"] = ""; } //set to empty string //callback (anon func PHP 5.0) $cb = function ($res) { pri($res); }; do_curl_post_request("http://ssu.5cf.de:3536", $_POST["proxy"], $_POST["delivery"], $cb); //main curl function function do_curl_get_request($url, $proxy, $delivery, $callback) { $curl = curl_init(); if (!is_string($proxy)) { $proxy = json_encode($proxy); } if (!is_string($delivery)) { $delivery = json_encode($delivery); } //build the query string $url .= "?proxy=" . urlencode($proxy) . "&delivery=" . urlencode($delivery); curl_setopt_array($curl, array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => 1)); $response = curl_exec($curl); if (!$response) {