Your "web page" can't be static, it must live in some sort of Web server. Then you'd construct the page using CGI, ASP, etc. techniques. Your code above is not using "regular VBScript" but instead VBScript in the context of the WSH script engine. To do what you want means something like ASP, where IIS and its ASP subsystem are the script host for VBScript, with different rules. The server gets the request from the client, wraps up the request info one way or another (depending on the dynamic Web technology and API you are using) and passes it to the "page" which contains script that runs. This "page" actually emits an HTML response back through the Web server for delivery back to the client. Things like ASP pages sort of look like HTML with script embedded, but the parts that appear to be HTML are actually parsed and wrapped up as Response.Write calls behind your back, and executed inline with the explicit script of the page. Example: <html> <body> <% Response.Write("Hello World!") %> </body> </html> The <% %> markers surround script to be executed. Anything outside those markers is considered literal text to be written out. In ASP you have a Request object passed to your script. This has properties for things like the QueryString. Request.QueryString is a collection, built from an expected string syntax of name=value pairs like: http://site/something.asp?name=John&age=30 This gives your ASP page a Request.QueryString collection with two items: name and age with values John and 30. If you break the rules and want to just grab the unparsed query string you could use Request.ServerVariables("QUERY_STRING") which would return the string value "name=John&age=30" instead.
|