<? 
   header
("Content-type: text/xml"); 
   
header("Connection: Keep-Alive"); 
   
header("Cache-Control: private"); 
?>
<? 
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"?>
<CiscoIPPhoneText>
    <Title>Stock Market Data</Title>
    <Prompt>Data from Yahoo Finance.</Prompt>

    <Text><?php
    $symbol 
$_GET['symbol'];
    
$file fopen ("http://quote.yahoo.com/d/quotes.csv?s=$symbol&f=sl1d1t1c1ohgv&e=.csv""r");
    if (!
$file) {
        echo 
"<p>Sorry, Unable to access online stock data.\n";
        exit;
    }
    while (!
feof ($file)) {
        
$line fgets ($file1024);
        list(
$symbol,$last,$date,$time,$change,$open,$high,$low,$volume) = 
            
explode(","$line);
        if(
$symbol <> "") {
            echo 
"Symbol:     $symbol\n";
            echo 
"Last Trade:\n";
            echo 
"  Date:  $date\n";
            echo 
"  Time:  $time\n";
            echo 
"  Price: $last\n";
            echo 
"Open:       $open\n";
            echo 
"High:       $high\n";
            echo 
"Low:        $low\n";
            echo 
"Volume:     $volume\n";
        }
    }
    
fclose($file);
 
?>
</Text>

    <SoftKeyItem>
        <Name>Update</Name>
        <URL>SoftKey:Update</URL>
        <Position>1</Position>
    </SoftKeyItem>

    <SoftKeyItem>
        <Name>Go Back</Name>
        <URL>SoftKey:Exit</URL>
        <Position>4</Position>
    </SoftKeyItem>
</CiscoIPPhoneText>