/**
* quote3.php
*
* Outputs price, low, and high of given symbol as text/html.
*
* David J. Malan
* Computer Science E-75
* Harvard Extension School
*/
// try to get quote
$handle = @fopen("http://download.finance.yahoo.com/d/quotes.csv?s={$_GET['symbol']}&f=e1l1hg", "r");
if ($handle !== FALSE)
{
$data = fgetcsv($handle);
if ($data !== FALSE && $data[0] == "N/A")
{
print("Price: {$data[1]}");
print("
");
print("High: {$data[2]}");
print("
");
print("Low: {$data[3]}");
}
fclose($handle);
}
?>