"; $debugHtml .= "php version: $phpversion
"; $debugHtml .= "account: $accountName
"; $debugHtml .= "curl support: ".function_exists("curl_init")."
"; $debugHtml .= "context stream support: ".ini_get("allow_url_fopen")."
"; die( $debugHtml ); } //check for php 5 if (floatval(phpversion()) < 5){ showErrorMessage("Sorry, this script needs PHP version 5 or newer.
Please contact your provider and ask for PHP 5. Usally this will be supported.

Need help? Please contact our technical support at support@neueshop.com."); } //get html from API $html = apiCall($url, $_POST); //output html $html = str_replace($siteId, "", $html); die( $html ); //-- functions //display an error message function showErrorMessage($msg){ global $errorUrl; $html = apiCall($errorUrl); if(empty($html)) die("Error

".$msg); $html = str_replace("##TITLE##", "", $html); $html = str_replace("##MESSAGE##", $msg, $html); die( $html ); } //call the api endpoint and get the result function apiCall($url, $POST="") { if( function_exists("curl_init") ){ //create cURL-Handle $ch = curl_init(); //set cURL options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $POST); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //call url and get feedback $feedback = curl_exec($ch); $ErrNum = curl_errno($ch); $ErrMsg = curl_error($ch); //close cURL-Handle and free memory curl_close($ch); } //cUrl is not supported, try context streams else { //get content with POST headers $opts = array( 'http'=>array( 'method'=>"POST", 'header'=>"Content-type: application/x-www-form-urlencoded\r\n", 'content'=>"POST=&".http_build_query($_POST) ) ); $context = stream_context_create($opts); $feedback = @file_get_contents("$url", false, $context); if(empty($feedback)) die("Error: need 'allow_url_fopen=on' support."); } return $feedback; } ?>