How can I avoid bypassing the logon page by typing a URL in the address bar?

Source: Internet
Author: User
Tags rtrim

Solution 1: Use two files to solve this problem:Userandpwd. aspAndSecretarticle. asp. The former is only responsible for providing the user name and password, and the latter is responsible for verification. In this way, even if you knowAsppwdrst. aspLocationURLAnd will never see anything.

Userandpwd. asp

<Html>

<Body>

<Form name = "form1" action =

"Secretarticle. asp" method _

= "POST">

<Input type = "hidden" name = "VTI-GROUP" value = _ "0">

<Div align = "center"> <center> <p>

Account<Input type = "text"

Name = "T1" size = "20">

Password<Input type = "password" name = "T2" size = _ "20">

<Input type = "submit" value ="Confirm"Name = _" B1 ">

</P> </center> </div>

</Form>

</Body>

</Html>

 

Secretarticle. asp

'Secret information page,And is responsible for verifying the account and password (account: Liyanbing,Password13066093625),After passing,Can be viewed.

<Html>

<% If rtrim (request. form ("t1") =

 "Liyanbing" and _ rtrim (request. form ("t2") =

 "13066093625" then %>

<Body>

<P align = "center"> <font face =""Size =" 7 "_ color =" # 0000ff ">

Congratulations,Logon successful!

</Font> </p>

</Body>

<% Else %>

<Body>

<P align = "center"> <font face =""Size =" 7 "_ color =" # 0000ff ">

Enter the user name and password!

</Font> </p>

</Body>

<% End if %>

</Html>

 

The second method is simpler, but the same function is implemented:

Login. asp

'Logon page

<% @ Language = vbscept %>

<@ Response. Buffer = true %>

<Html>

<Head> <title>Welcome to Alibaba Cloud</Title>

<Body>

<%

If request ("username") = "liyanbing" and request ("password") = "13066093625" then

Response. redirect "chunfeng. asp"

'Default Account: Liyanbing;Password: 13066093625;Document page: Chunfeng. asp.

End if

%>

<Font style = "font-size: 12pt">Enter your account and password"</Font> <br>

<Form action = "login. asp" method = "post">

<Br>Account: <Input type = text name = "username">

<Br>Password: <Input type = password name = "password">

<Br> <input type = submit value ="Login">

</Form>

</Body>

</Html>

 

[1]

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.