Implementation of pseudo-static code by ASP

Source: Internet
Author: User
Tags servervariables

Take advantage of Request.ServerVariables ("query_string") to obtain the received value (? After the parameter).

For example [Url=http://www.111cn.net/?3-8.html]http://www.111cn.net/?3-8.html[/url] Receive is 3-8.html, 3-8.html filter, only need to get parameters 3 and 8, according to 3 and 8 to retrieve data from the database, followed by the same as dynamic ASP.

This can realize the pseudo static HTML of ASP.

<%
Dim id,id1,id2,a,b
Id=request.servervariables ("Query_string") Id1=replace (ID, ". html", "")
Id2=split (ID1, "-")
A=id2 (0)
B=id2 (1)
Response.Write "A parameter value is:" &a& "<br>b parameter value is:" &b
' Here you've got the A, b parameters required for the show.asp file.
' Use this parameter to open the database as before and get the content.
%>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.