views:

29

answers:

1

I use the example for POST, found here.

On a windows 7 machine it doesn't show the chart, just the image's ALT text (which I added to the example). When I upload the two files to my website it works just fine.

Has anyone else tried this with XAMPP? Would someone? If it works for you on localhost can you please paste the entire code of your text page & I will award the answer. Thanks.


Btw: here's my test page. The other file chartserver-image.php is as per Google's page

<?php 
  echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\"&gt;";  
  echo "<html>";  
  echo "<head>";  
  echo "<title>Where's my Google Chart, then?</title>";  
  echo "<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\">";  
  echo "<meta HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">";  
  echo "<meta HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">";  
  echo "<style type=\"text/css\">";  
  echo "  body { font: 12px Arial; }";  
  echo "</style>";  
  echo "</head>";  
  echo "<body>";  

  echo "<div>";  
  echo "<img width='600' height='200' src='chartserver-image.php' alt='alt text'>";  
  echo "</div>";  

  echo "</body>";
  echo "</html>";
?>
+1  A: 

Most probably, the fopen wrappers are not set correctly for HTTP requests. As the chartserver-image.php makes the fopen request.

So, in your browser, directly go to this link:

 http://localhost/path/to/file/chartserver-image.php

Remember to change the path accordingly. You will see the error and what's going on. BTW, it has nothing to do with the code you posted.

shamittomar
+1 and thank you. I suspect that you are correct. If it works on my live website, but not locally then it sounds like a configuration problem. Unfortunately, when I load http://localhost/a/chartserver-image.php I get teh unhelpful message "http://localhost/a/chartserver-image.php" - no details of which errors - and I made sure it is identical to Goggle's example. Perhaps if you can tell me how to tweak my local php.ini for the fopen() wrappers?
Mawg