- Code: Select all
define('BASEPATH', str_replace('\\', '/', dirname(__FILE__)) . '/');
$upload_url = $_POST["upload_url"];
$post_params['photo'] = '@'.BASEPATH."1.png";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $upload_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
$result = curl_exec($ch);
curl_close($ch);
$result = json_decode($result);
$mess = array ('server' => $result->server, 'photo' => $result->photo, 'hash' => $result->hash);
echo json_encode($mess);
in previous versions of the code worked fine. But in the final with php 5.6.3 rabotaet.S not what is the reason? For earlier thanks.