To illustrate what's wrong with the code from the book,
this code works:
$symbol="ibm";
echo "Stock Quote for $symbol\n";
$theurl="http://finance.yahoo.com/q?s={$symbol}&d=v1";;
if (!($fp=fopen($theurl, "r")))
{
echo "Could not open the URL";
exit;
}
$contents= fread($fp, 100);
fclose
You get that message when it doesn't match the
pattern "(\\\$[0-9]+\\.[0-9]+)" in the returned
data.
$quote is set by eregi();
All this stuff is in the php documentation:
http://php.net/eregi
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-2