In the example below we will display the latest daily stock chart for a given company . A form will be displayed to the user allowing them to enter a valid stock symbol for a company . Typical symbols are MSFT for Microsoft and SUN for Sun. The first part checks to see if there has been an entry on the form , if not the form is displayed again . <% If a user does enter a ticker symbol then the appropriate chart is displayed using the code in the second section. else <img border="0" src="http://ichart.yahoo.com/t?s=<%= Request.Form("ticker")%>"> The complete code is displayed below |
| <% 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")%>"> |
discuss this topic to forum
