Jump to content

HTML Parameter


jkusmanto

Recommended Posts

Hi all,As a beginner I would like to ask a question.I have made 2 pages: callit.html and callpara.asp.Here is the code :callit.html :---------------------------------------<html><head><title>Caller</title></head><body><a href="callpara.asp?param=nl">Nederlands</a><br /><a href="callpara.asp?param=fr">Français</a><br /><a href="callpara.asp?param=de">Duits</a><br /><a href="callpara.asp?param=en">English</a></body></html>callpara.asp :---------------------------------------<html><head><title>Call with parameter</title></head><body><table> <tr><td>The parameter is: <% request.QueryString("param") %></td></tr> <tr><td> <% select case request.QueryString("param") case "nl" %>Ik spreek Nederlands <% case "fr" %>Je parle Français <% case "de" %>Ich spreche Deutsch <% case "en" %>I speak English <% end select %> </td></tr></table></body></html>The result is :---------------------------------------The parameter is: Ik spreek Nederlands Je parle Français Ich spreche Deutsch I speak English-------I call callpara.asp from callit.html.If I click on one of the languages, the language will be shown on screen.Example :If I click on Duits, the result should be like this :The parameter is: deIch spreche DeutschIf I click on English, the result should be like this :The parameter is: enI spreak EnglishBut the result is not what I want.Can anybody help me please?Regards,JKusmanto

Link to comment
Share on other sites

Select in VBScript doesn't have a break, and it doesn't use { } or semicolons either. You're right about the request object not printing, but all he was missing was an equals to get it to print:<%=request.QueryString("param") %>

Link to comment
Share on other sites

Thanks guys for youe replay.I have changed it to <%=request.QueryString("param") %>But it still didn't work. The result is the same.For the select-case problem, how to solve it?Thanks.Jkusmanto

Select in VBScript doesn't have a break, and it doesn't use { } or semicolons either. You're right about the request object not printing, but all he was missing was an equals to get it to print:<%=request.QueryString("param") %>
Link to comment
Share on other sites

Maybe just try using response.write instead of closing the ASP tags. Since it was printing out all 4 entries, it might not be parsing the select correctly.

<% select case request.QueryString("param")  case "nl" 	response.write("Ik spreek Nederlands")  case "fr" 	response.write("Je parle Français")  case "de"	response.write("Ich spreche Deutsch")  case "en" 	response.write("I speak English")  case else	response.write("Invalid parameter: '" & request.QueryString("param") & "'")end select %>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...