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



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
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!"
Else
	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.
	'*****************************************************************
	'Response.End
End If
%>
<FORM ACTION="login.asp" METHOD="post">
<TABLE BORDER=0>
	<TR>
		<TD ALIGN="right">Login:</TD>
		<TD><INPUT TYPE="text" NAME="login"></INPUT></TD>
	</TR>
	<TR>
		<TD ALIGN="right">Password:</TD>
		<TD><INPUT TYPE="password" NAME="password"></INPUT></TD>
	</TR>
	<TR>
		<TD ALIGN="right"></TD>
		<TD><INPUT TYPE="submit" VALUE="Login"></INPUT>
			<INPUT TYPE="reset" VALUE="Reset"></INPUT>
		</TD>
	</TR>
</TABLE>
</FORM>
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

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

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