sevans Posted September 10, 2007 Share Posted September 10, 2007 Here is the code I was left to work with since the guy who wrote it is away, anyway i am not that good with PHP so any help would be greatly appreciated. it keeps telling me the tickersymbol is not registered. now this could be because of Yahoo finance, and I beleive the URl may be wrong Im not sure. you can go here to see the error. http://www.oncologymed.com/investor_relations.php ------------------------------------------------------------- <!-- Begin stock ticker code --> <? //enter the stock symbol here $tickersymbol = "ONCO.PK"; if (isset($tickersymbol)) { $open = fopen("http://quote.yahoo.com/d/quotes.csv?s=$tickersymbol&f=sl1d1t1c1ohgv&e=.csv", "r"); $read = fread($open, 2000); fclose($open); $read = str_replace("\"", "", $read); $read = explode(",", $read); IF ($read[1] == 0) { echo ("The symbol (<b>\"$tickersymbol\"</b>) doesn't appear to be registered<BR></FONT><BR>"); } ELSE { ?> <div align="center"> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=1 WIDTH=166> <TR bgcolor="#FFE3C1"> <TD width=45 align="left"><font color="#CC9966" face="Arial, Helvetica, sans-serif" size="2"><strong><? echo ("$read[0]"); ?></strong></font></TD> <TD width=94 align="right" valign="middle"><font color="#CC9966" face="Arial, Helvetica, sans-serif" size="2"><strong><? echo ("$read[3]"); ?></strong></font></TD> </TR> <TR valign="middle"> <TD align="left"><font color="666600" size="1" face="Arial, Helvetica, sans-serif">Current:</font></TD> <TD align="right" valign="middle"><font color="666600" size="1" face="Arial, Helvetica, sans-serif"><? echo ("$read[1]"); ?></font></TD> </TR> <tr> <td colspan="2"><hr size="1" noshade></td> </tr> <TR valign="middle"> <TD align="left"><font color="666600" size="1" face="Arial, Helvetica, sans-serif">Change:</font></TD> <TD align="right" valign="middle"><font color="666600" size="1" face="Arial, Helvetica, sans-serif"><? echo ("$read[4]"); ?></font></TD> </TR> <tr> <td colspan="2"><hr size="1" noshade></td> </tr> <TR valign="middle"> <TD align="left"><font color="666600" size="1" face="Arial, Helvetica, sans-serif">Opened At:</font></TD> <TD align="right" valign="middle"><font color="666600" size="1" face="Arial, Helvetica, sans-serif"><? echo ("$read[5]"); ?></font></TD> </TR> <tr> <td colspan="2"><hr size="1" noshade></td> </tr> <TR valign="middle"> <TD align="left"><font color="666600" size="1" face="Arial, Helvetica, sans-serif">Day Range:</font></TD> <TD align="right" valign="middle"><font color="666600" size="1" face="Arial, Helvetica, sans-serif"><? echo ("$read[6] - $read[7]"); ?></font></TD> </TR> <tr> <td colspan="2"><hr size="1" noshade></td> </tr> <TR valign="middle"> <TD align="left"><font color="666600" size="1" face="Arial, Helvetica, sans-serif">Volume:</font></TD> <TD align="right" valign="middle"><font color="666600" size="1" face="Arial, Helvetica, sans-serif"><? echo ("$read[8]"); ?></font></TD> <tr> <td colspan="2" height="1" bgcolor="#FFE3C1"> </td> </tr> </TABLE> </div> <? } } ?> <!-- End stock ticker code --> Link to comment https://forums.phpfreaks.com/topic/68710-solved-error-with-stock-ticker-code/ Share on other sites More sharing options...
GingerRobot Posted September 10, 2007 Share Posted September 10, 2007 Well, a quick check of the source code tells me none of your PHP is being executed. This could be for a number of reasons. Hopefully it is just a case of the short_open_tags directive being set to off. Try using full opening tags (<?php) instead of short ones (<?). Link to comment https://forums.phpfreaks.com/topic/68710-solved-error-with-stock-ticker-code/#findComment-345396 Share on other sites More sharing options...
sevans Posted September 10, 2007 Author Share Posted September 10, 2007 Wow thats it i turned it on and it works. Thanks for that quick fix. I cant believe i was looking in the wrong place. AWESOME!!!! Link to comment https://forums.phpfreaks.com/topic/68710-solved-error-with-stock-ticker-code/#findComment-345401 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.