<% '******************************************************* '* ASP 101 Sample Code - http://www.asp101.com/ * '* * '* This code is made available as a service to our * '* visitors and is provided strictly for the * '* purpose of illustration. * '* * '* http://www.asp101.com/samples/license.asp * '* * '* Please direct all inquiries to webmaster@asp101.com * '******************************************************* %> <% '************************************************************************** ' 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 cool stuff 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 %>
Hint: Both the login and password are 'Guest'. Note that they are CaSe SeNSiTiVe!