Navigation :

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




Site Sponsors :

Bookmark :

Links :

golfing products
low cost magazines
programmershelp

Downloads :

Misc :

Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!



 

This version allows users to enter the company name and it displays the corresponding ticker symbols.

Here is the updated code

<form action="<? echo($PHP_SELF); ?>" METHOD="POST">
<input type="text" name="company">
<input type="submit" NAME="action" value="Submit">
</form>
<?php
if ($action)
{
//this is the company you wish to lookup
//$company = "";
//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);
}
?>