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
golfing products
finance products
dropshippers
 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
image_string example(image)
count characters in a sentence(string)
Page last accessed(date and time)
 Random Article
  Network
Programming resources
Tutorials directory
Clickbank mall
sell software
Free auctions, low cost stores
UK products
US products
Gambling directory
Sexy free wallpapers
Hosting resources
ASP site
DVD site
Domain names
Dating site
Software directory
Maxi directory
bigarticle : free articles




beginners PHP Copyright © 2004 onwards by beginnersPHP.