CodeAve.com CodeAve.com - ASP - Miscellaneous
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Password Protection (Hardcoded Value)
There are many ways to provide limited access to an active server page.  The most reliable would involve NT authentication.  However, setting up all the resources can be a bit much for some of your simpler security needs.  The following example is the simplest way to provide low-level security to an asp application.  There is only one password that will grant access to the restricted content of the page (codeave) that is hard-coded into the script.
View the Output
Text View
Print View
Mail this Link
Download the Code

<% 
u_password=request.form("u_password")

' Checks the value of the password being submitted
' If the password is correct then the restrict access content will display
select case u_password
case "codeave"
%>

Restricted content to be displayed to properly registered users only
<%
case else
' Checks to see if the user has submitted a password or if one was submitted 
' If there is no value in u_password field or if it is anything
' other than codeave then the input form will display
' prompting the user to input the appropriate information
if (u_password <> "codeave" and u_password <> "") then 
' If the password submitted in not null then display a message
' informing the user that an incorrect password was supplied
response.write "The password you have entered is incorrect"
end if 
if (u_password <> "codeave" and u_password = "") then 
' If the password submitted is not null then display a message
' informing the user to enter a password
response.write "Please Sign-In"
end if 
%>


<form action="<%= request.servervariables("script_name") %>" method="POST">
User Name:<br><input type="text" name="u_name" length="20" maxlength="10"><br>
Password:<br><input type="password" name="u_password" length="20" maxlength="10">
<input type="Submit" value="Submit">
</form>

<%
end select
%>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3