Share a piece of code: Show. asp? Id = 26 to show /? 26 format

Source: Internet
Author: User

I found that many ASP systems are calling ArticleIf static data is not generated, the output is similar.
Http://www.xxx.com/show.asp? Id = 26.

If you can change to http://www.xxx.com/show? 26 This format seems to have been removed a lot. Of course, for space that supports pseudo-static
It can also be set to http://www.xxx.com/show/26 said Yang can increase the probability of Search Engine indexed.

CodeAs follows:
First, create a show directory and create an index. asp file, which is the default file of the system.
Then, if it was show. asp? When id = 26, the show file first needs to get the ID
Id = request. querystring ("ID ")
And so on. Here we replace the obtained ID with, get? Use the following code to return the number.
Id = lcase (TRIM (request. servervariables ("QUERY_STRING ")))

Other database connection methods remain unchanged

Set rs = server. Createobject ("ADODB. recordset ")
Rs. Open "select * from blog where id =" & ID, Conn, 3,3

You can try it.

Here is a demo:

Http://www.aubaby.cn/shop? 26

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.