Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
karenk

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:

 

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...