Two methods of using ASP to realize Web page secrecy

Source: Internet
Author: User
Tags rtrim
Author: Hu Sunliang

I am in the maintenance of the company's internal Web site encountered a practical problem--mis supervisor required to put some technical documents on the Web page, and can only let MIS staff browsing. This involves the question of how to keep a Web page secret.

Originally, I designed a scheme with FrontPage and VBScript to link the MIS technology page (which is preset to actpwdrst.htm) before linking the actpwd.htm input name and password (here The name and password are all preset to "mis", and only after the correct input can you link to actpwdrst.htm. The following are their code.

The actpwd.htm code is as follows:

< HTML >
< head >
< title > Password </title >
< BODY >
< form name= "Form1" >
< input type= "hidden"
Name= "Vti-group" _ value= "0" >
< div align= "center" >< Center >< p >
Name < INPUT type = "Text"
Name= "T1" Size=_ ">"
Password < input type = "Password"
Name= "T2" _ Size= ">"
< input type= "button" value= "
Confirm "_ Name=" B1 ">
</P ></center ></div >
</form >
< p >
< script language= "VBScript" >
<!-
Sub B1_onclick ()
If form1.t1.value= "mis" and_ form1.t2.value= "mis" then
Document.location=_ "Actpwdrst.htm"
Else
M1=msgbox ("Password Error _
", 0+48," Warring ")
End If
End Sub
-->
</script >
</p >
</body >
The actpwdrst.htm code is as follows:
< HTML >
< head >
< title > Password </title >
< BODY >
< p align= "center" >
< font face= "standard italics" size= "7" color= "0000FF" >
< strong >
You have successfully logged in!
</strong >
</font >
</p >
</body

Careful friends may have discovered the unreliability of this scenario--both input and judgment are done in actpwd.htm, regardless of whether the name and password are correct, as long as you remember ACTPWDR The URL where st.htm is located does not need to be directly linked to actpwdrst.htm through actpwd.htm. So the secrecy coefficient of this scheme is not very good.
Here is a look at the use of ASP design scheme. Before linking the MIS technology page (preset to asppwdrst.asp), link the asppwd.asp input name and password (where the name and password are preset to "mis"), and only after the correct input can Link to asppwdrst.asp. The following are their code.

The asppwd.asp code is as follows:
< HTML >
< BODY >
< form Name= "Form1" action=
"Asppwdrst.asp" Method_
= "POST" >
< input type= "hidden" name=
"Vti-group" value=_ "0" >
< div align= "center" >< Center >< p >
Name < input type= "text"
Name= "T1" size= ">"
Password < input type =
"Password" name= "T2" Size=_ ">"
< input type= "submit" value=
"Confirm" name=_ "B1" >
</P ></center ></div >
</form >
</body >
The asppwdrst.asp code is as follows:
< HTML >
<% if RTrim (Request.Form ("T1")) =
"Mis" and_ RTrim (Request.Form ("t2")) =
"MIS" then% >
< BODY >
< p align= "center" >< Font face=
"Standard italics" size= "7" _ Color= "#0000ff" >
< strong > You have successfully logged in!
</strong ></font ></p >
</body >
<% Else% >
< BODY >
< p align= "center" >< Font face=
"Standard italics" size= "7" _ Color= "#0000ff" >
< strong > Please enter the correct username and password
</strong ></font ></p >
</body >
<% End If% >

In this scenario, asppwd.asp only provides the input function, while the name and password confirmation work is done by asppwdrst.asp. This way, even if you remember the URL where asppwdrst.asp is located, you don't see the specific content. Therefore, the use of this scheme to design the Web page confidentiality coefficient is very high.



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.