Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- classic ASP one page security
- domainUsername = Request.ServerVariables("AUTH_USER")
- if domainUsername = "domainusera" or domainUsername = "domainuserb" then
- 'show numbers
- else
- 'show error
- end if
- <%
- Function Login(username,password)
- Login = False
- If Trim(LCase(username)) = "somebodywhocanseethepage" And Trim(LCase(password)) = "opensaysame" Then
- Login = True
- End If
- End Function
- Sub WriteLoginForm()
- %>
- <form action="<%= Request.ServerVariables("SCRIPT_NAME") %>" method="post">
- <input type="hidden" name="_TRIGGER" id="_TRIGGER" value="LOGIN" />
- Username: <input type="text" name="username" id="username" /><br />
- Password: <input type="password" name="password" id="password" /><br />
- <input type="submit" value="Login" />
- </form>
- <%
- End Sub
- Sub WritePageContent()
- %>
- <h1>Phone Numbers</h1>
- <ul>
- <li>867-5309</li>
- <li>911</li>
- <li>2 8 1, 3 3 oh, eight zero zero fo'</li>
- </ul>
- <%
- End Sub
- If Request.Form("_TRIGGER") = "LOGIN"
- If Login(Request.Form("username"),Request.Form("password"))
- WritePageContent
- Else
- Response.Write "Login failed.<br />"
- WriteLoginForm
- End If
- Else
- WriteLoginForm
- End If
- %>
- <%
- if request.querystring("mysecretquery") = "mypassword" then
- %>
- <html>
- <body>
- My data.
- </body>
- </html>
- <%
- else
- response.write("Error")
- end if
- %>
Add Comment
Please, Sign In to add comment