<?
$hst = "localhost";
$db = "xxxx";
$usr = "xxxxx";
$pwd = "xxxxx";
$conn_DB=mysql_connect($hst,$usr,$pwd) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES 'utf8'");
mysql_query("SET COLLATION_CONNECTION = 'utf8_unicode_ci'");
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, 'php://input');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$query = curl_exec($ch);
curl_close($ch);
// display file
echo $query;
//$query = file_get_contents("php://input");
$sth = mysql_query($query);
...