ASP 101 - Active Server Pages 101 - Web01
The Place ASP Developers Go!

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

ASP Source Code:
' This type of script becomes more useful and managable when you are
' comparing these values to those stored in a database or some other source
' of user information instead of hard coding them into the actual code.
' Just be sure that if a data source error arises you don't inadvertantly
' end up giving access to the pages you are trying to protect!
If Request.Form("login") = "Guest" AND Request.Form("password") = "Guest" Then
	Response.Write "This is all the <B>cool stuff</B> we are trying to protect!"
	Response.Write "Access Denied!"
	' Note: we don't use the next line so that our description below
	' the script comes in.  If you wanted to just stop everything here
	' you would un-comment the next line and it would stop execution.
End If
<FORM ACTION="login.asp" METHOD="post">
		<TD ALIGN="right">Login:</TD>
		<TD><INPUT TYPE="text" NAME="login"></INPUT></TD>
		<TD ALIGN="right">Password:</TD>
		<TD><INPUT TYPE="password" NAME="password"></INPUT></TD>
		<TD ALIGN="right"></TD>
		<TD><INPUT TYPE="submit" VALUE="Login"></INPUT>
			<INPUT TYPE="reset" VALUE="Reset"></INPUT>
Hint: Both the login and password are 'Guest'.  Note that they are CaSe SeNSiTiVe!<BR>

Back the the Sample Output

Back to the Sample Index

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers