开发者

Anyone having problems with Google charts in XAMPP?

开发者 https://www.devze.com 2023-01-15 19:55 出处:网络
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

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 m开发者_开发百科y 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\">";  
  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>";
?>


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消