Display stock market information

OK , we are continuing our line of stock scripts with this example . In this example we will let the user select a stock market from a list and then we will display a yearly chart of the data . Examples of markets included in this example are Dow Jones , FTSE 100 , Hang Seng and Nasdaq . This is a useful addition for anyone who has a stock market related site or a financial site .

Code :

<%
if Request.Form("index") = "" Then
%>

<form action = <%=Request.ServerVariables("SCRIPT_NAME") %> method = post>
<select name="index">
<option>Nasdaq</option>
<option>Dow Jones</option>
<option>S & P 500</option>
<option>FTSE 100</option>
<option>FTSE 250</option>
<option>Hang seng</option>
</select>
<input type = submit value = "submit">
</form>
<%
else

strIndex = Request.Form("index")
Select Case (strIndex)
Case "Nasdaq":
url = "http://chart.yahoo.com/c/1y/_/_ixic.gif"
Case "Dow Jones":
url = "http://chart.yahoo.com/c/1y/_/_dji.gif"
Case "S & P 500":
url = "http://chart.yahoo.com/c/1y/_/_spc.gif"
Case "FTSE 100":
url = "http://chart.lng.yahoo.com/c/1y/_/_ftse.gif"
Case "FTSE 250":
url = "http://chart.lng.yahoo.com/c/1y/_/_ftmc.gif"
Case "Hang seng":
url = "http://chart.yahoo.com/c/1y/_/_hsi.gif"
End Select


Response.Write "<b>" & strIndex & "</b><br>"
Response.Write "<img src = " & url
End If
%>


Sponsors