Jump to content
Larry Ullman's Book Forums

Ch10 Script 10.01 Get_Quote.php Not Working


Recommended Posts

Hi

 

When attempting to open this file and get a quote (KO) coca cola, NYSE

 

I get the following error: (Please note that this file is directly from the downloads)

 

Have I done something wrong?

 

Tx :)

Karen

 

Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/html/php_advanced/ch10/get_quote.php on line 18

Warning: fopen(http://quote.yahoo.com/d/quotes.csv?s=KO&f=nl1): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/html/php_advanced/ch10/get_quote.php on line 18

Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /var/www/html/php_advanced/ch10/get_quote.php on line 21

Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/html/php_advanced/ch10/get_quote.php on line 24

The latest value for (KO) is $.
Enter a NYSE stock symbol to get the latest price:

 

 

Link to comment
Share on other sites

Interesting! When I click on the Yahoo! link to access it in my browser, it does work, so that's not the problem. My best guess is this is a server problem, specifically with the DNS. You can confirm this by changing "quote.yahoo.com" to 72.30.203.4 (Yahoo's IP address) and seeing if it works then.

Link to comment
Share on other sites

 Share

×
×
  • Create New...