Implement the automatic station with ASP. Implement virtual Level two directory

Source: Internet
Author: User

Previously wrote a website to automatically build the station system. But recently to write a do not automatically generated, but to do:
http://www.knowsky.com/ User name
So I want a user to create a directory. But I think if the W user. That's not what I want to build on the W directory.
So I used IIS 404 error and Analysis of the error message to write an automatic steering code.
First, all 404 IIS Errors. Point to: Url:/website.asp?webname= $V

Then create one below the root directory of the Web site:
Website.asp
The contents of the-----------------are as follows-------------------'
<%@ codepage = "936"%>
<!--#include file= "conn/dbconn.asp"-->
<%
Webname=trim (Request.QueryString ("WebName"))
Webname=right (Webname,len (WebName)-instr (WebName, "80")-2)
Set rs = Conn.execute ("Select ID from Qyml where user= '" &WebName& ")
If Rs.eof Then
Response.Write ("File not found!")
Else
Response.Redirect ("/show/index.asp?id=" &rs ("id"))
End If
%>
'------------------------------------------------'

OK, fully implemented, do not have to create more than n directories.



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.