enlightenmental Posted December 7, 2008 Share Posted December 7, 2008 (edited) this is a simple php script that allows the user to view stock quote tickers by simply entering the ticker into the form Ive seen this script functioning on several websites It doesnt work on mine!! - godaddy hosting - PHP 5 php.ini file with: register_globals = true allow_url_fopen = true Please help script expandcollapse popup<? if (!isset($tickersymbol)) { echo (" Welcome to Stock Port. Here you can view individual stocks by entering the proper Ticker Symbol into the proceeding form.<p>"); ?> <? } else 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 you provided (<b>\"$_POST[tickersymbol]\"</b>) doesn't appear to be registered<BR></FONT><BR>"); } else { ?> <div align="center"> <!-- YOU CAN CHANGE THE TABLE BELOW TO MATCH YOUR WEB SITE --> <TABLE BORDER=1 BORDERCOLOR="#006699" CELLSPACING=0 CELLPADDING=0 WIDTH=500> <TR> <TD width=150><b>Ticker Symbol</b>:</TD> <TD><? echo ("$read[0]"); ?></TD> </TR> <TR> <TD width=150><b>Last Trade</b>:</TD> <TD><? echo ("$read[1]"); ?></TD> </TR> <TR> <TD width=150><b>Last Trade At</b>:</TD> <TD><? echo ("$read[2] $read[3]"); ?></TD> </TR> <TR> <TD width=150><b>Change</b>:</TD> <TD><? echo ("$read[4]"); ?></TD> </TR> <TR> <TD width=150><b>Opened At</b>:</TD> <TD><? echo ("$read[5]"); ?></TD> </TR> <TR> <TD width=150><b>Day Range</b>:</TD> <TD><? echo ("$read[6] - $read[7]"); ?></TD> </TR> <TR> <TD width=150><b>Volume</b>:</TD> <TD><? echo ("$read[8]"); ?></TD> </TABLE> <p> <img src="http://ichart.yahoo.com/t?s=<? echo ("$read[0]"); ?>"> </div> <? } } ?> <p> <div align="center"> <FORM ACTION="<? echo ("$PHP_SELF"); ?>" METHOD="POST"> <table border=0 cols=2 width=200> <tr> <td width=100> Ticker Symbol: </td> <td width=100> <input type=text name="tickersymbol"> </td> </tr> <tr align="center"> <td colspan=2> <input type=submit value="Check Stock"> </td> </tr> </table> </FORM> </div> Edited December 7, 2008 by enlightenmental Link to comment Share on other sites More sharing options...
Pain Posted December 7, 2008 Share Posted December 7, 2008 This is a AutoIt Forum not a PHP forum or you are trying to translate it into AutoIt code?If so look at FileOpen, FileRead, StringReplace and some related functions in the helpfile. Link to comment Share on other sites More sharing options...
enlightenmental Posted December 7, 2008 Author Share Posted December 7, 2008 This is a AutoIt Forum not a PHP forum or you are trying to translate it into AutoIt code?If so look at FileOpen, FileRead, StringReplace and some related functions in the helpfile.oops.... this is the best forum I found when searching "forum on php"not sure what autoit even is.... would be nice if someone could still assist me(i'll start looking for another forum)thanks Link to comment Share on other sites More sharing options...
Pain Posted December 7, 2008 Share Posted December 7, 2008 Try http://www.php.net/ Link to comment Share on other sites More sharing options...
yxrkt Posted December 7, 2008 Share Posted December 7, 2008 CODE<?php $tickersymbol = $_POST['tickersymbol']; if (!isset($tickersymbol)) { echo (" Welcome to Stock Port. Here you can view individual stocks by entering the proper Ticker Symbol into the proceeding form.<p>"); ?> <?php } else 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 you provided (<b>\"$_POST[tickersymbol]\"</b>) doesn't appear to be registered<BR></FONT><BR>"); } else { ?> <div align="center"> <!-- YOU CAN CHANGE THE TABLE BELOW TO MATCH YOUR WEB SITE --> <TABLE BORDER=1 BORDERCOLOR="#006699" CELLSPACING=0 CELLPADDING=0 WIDTH=500> <TR> <TD width=150><b>Ticker Symbol</b>:</TD> <TD><?php echo ("$read[0]"); ?></TD> </TR> <TR> <TD width=150><b>Last Trade</b>:</TD> <TD><?php echo ("$read[1]"); ?></TD> </TR> <TR> <TD width=150><b>Last Trade At</b>:</TD> <TD><?php echo ("$read[2] $read[3]"); ?></TD> </TR> <TR> <TD width=150><b>Change</b>:</TD> <TD><?php echo ("$read[4]"); ?></TD> </TR> <TR> <TD width=150><b>Opened At</b>:</TD> <TD><?php echo ("$read[5]"); ?></TD> </TR> <TR> <TD width=150><b>Day Range</b>:</TD> <TD><?php echo ("$read[6] - $read[7]"); ?></TD> </TR> <TR> <TD width=150><b>Volume</b>:</TD> <TD><?php echo ("$read[8]"); ?></TD> </TABLE> <p> <img src="http://ichart.yahoo.com/t?s=<?php echo ("$read[0]"); ?>"> </div> <?php } } ?> <p> <div align="center"> <FORM ACTION="<?php echo "#" ?>" METHOD="POST"> <table border=0 cols=2 width=200> <tr> <td width=100> Ticker Symbol: </td> <td width=100> <input type=text name="tickersymbol"> </td> </tr> <tr align="center"> <td colspan=2> <input type=submit value="Check Stock"> </td> </tr> </table> </FORM> </div> Link to comment Share on other sites More sharing options...
KaFu Posted December 7, 2008 Share Posted December 7, 2008 (edited) First read... than post... (and I mean myself )... Edited December 7, 2008 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now