Your Ad Here

 Navigation
Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




 Sponsors
 Links
dropshippers
golfing products
low cost magazines
 Downloads
 Misc
Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


Stock ticker lookup


Stock ticker lookup

OK you have used the quote scripts on this site and they work well but they have one problem , you must know the ticker symbol in advance . We solve this problem with the following script which uses another of yahoo's useful services . In this example we enter a company name (this could come from a form with a bit of modification) and then we display the results on the page .

Here is the script

<?php
//this is the company you wish to lookup
$company = "ntl";
//this is the url from yahoo + the company
$url = "http://quote.yahoo.com/l?m=&s=" . $company . "&t=";
//open the url and store in $fp
$fp = fopen($url , "r");
//read 20000 bytes of the file
$readfile = fread($fp , 20000);
//search for the HTML below and store everything in between in $content
$readfile = ereg("<TABLE border=0 cellPadding=2 cellSpacing=0 width=100%>(.*)<small>Add</small>" , $readfile, $content);
//display the results in a table
echo "<table width = '100%'>";
echo "$content[1]";
echo "</table>";
//close the file handle
fclose($fp);
?>

And here is the output




Books
 Sponsors
 Random Code
Size of a webpage with PHP and cURL(internet)
hexadecimal to decimal conversion(math)
Display someone elses metatags(internet)
 Random Article
  Network
Programming resources
Tutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials




beginners PHP Copyright © 2004 onwards by beginnersPHP.