I have a php script that sends request to url. But result is empty.
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_ENCODING , "gzip, deflate");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/x-www-form-urlencoded',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp',
'Connection: Keep-Alive',
'User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36'
));
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'Format'=>'image/png',
'width'=>'550',
'height'=>'250',
));
$reuslt = curl_exec($ch);
$error_no = curl_errno($ch);
curl_close($ch);
I write echo $reuslt;
but this gives error like this: Notice: Undefined variable: result
I write echo $error;
this writes result 0
This query result should return a png image to my browser, but returs nothing.
It should be $result
everywhere not $reuslt
(or otherway, but not mixed)