I'm trying to use POST method in my PHP code.
I copied the example source code from this page :
But I've got some unexpected issues ...
In Firefox, the image doesn't display and I've got an error message :
"The image cannot be displayed beacause it contains errors."
And IE just displays some error and random characters such as :
<b>Notice</b>: fopen() [<a href='function.fopen'>function.fopen</a>]:
Content-type not specified assuming application/x-www-form-urlencoded
in <b>C:\Program Files\EasyPHP5.2.10\www\ChartsGoogle\chartserver-
image.php</b> on line <b>23</b><br />
IHDR XÈ »ý á bKGDÿÿÿ ½§“ IDATxœì½i”$×u øedfäV•µuõ Ñº ± 4)Š”`I IY
¢†ò*Ó r$j;ã9öŒíñŒäñ ......
Seems like there is a problem with the headers sending in the HTTP
request, and some problems with the fopen function ...
Did anyone ever met this problem ? How to solve it ?
It maybe caused by EasyPHP or some wrong configuration ?
Thank for your help :)
juste replace the context by this one :
$context = stream_context_create(
'http' => array(
'method' => 'POST',
'content' => http_build_query($chart),
'header' => "Content-Type: application/x-www-form-
and it will work :)