Showing charts for a ticker symbol

The normal method of showing stock information for a selected ticker symbol is pure numerical data , now this is fine but on a lot of financial sites they are able to display charts as well . This would be great if you could add this to our site well stay tuned as I am going to show you how to .

Here is the script , copy and paste this on to a new page call it something like stockchart.php and test it out .

<%
If Request.Form("ticker") = "" Then
%>
<html><body>
<form action = <%= Request.ServerVariables("SCRIPT_NAME") %> method = post>
Enter your ticker symbol :<input type = text name = ticker size = 6><br>
<input type = submit value = "show chart">
</form>
</body></html>
<%
else
%>
<html>
<head>
</head>

<img border="0" src="http://ichart.yahoo.com/t?s=<%= Request.Form("ticker")%>">
</body>
</html>
<%
End If
%>

Pretty simple idea firstly we check if the user entered anything in the text box , if not we simply display the form again . If a user has entered a ticker symbol we then display this on the screen .

 

Sponsors

Books

cover

Professional Active Server Pages 3.0

cover

Beginning ASP Databases

cover

ASP in a Nutshell: A Desktop Quick...