How can I password protect my page?

Results 1 to 4 of 4

Thread: How can I password protect my page?

  1. #1
    Join Date
    Dec 1969
    Posts
    62

    Default How can I password protect my page?

    I’m new at this… I have a page I need to protect. This page doesn’t need any hardcore protecting but needs to be protected with a password. Can anyone help? Thanks, Sendo

  2. #2
    Join Date
    Dec 1969
    Posts
    2,854

    Default Heres a Start

    This is a Front Page, you will need to Track the sessions around on the other pages, if they don&#039;t exist, redirect back to this page.......<BR><BR>&#060;%@Language="VBSCript"%&#0 62;<BR>&#060;html&#062;<BR>&#060;head&#062;<BR>&#0 60;%if ucase(Request.Form("uname")) = "YourUserName" and ucase(Request.Form("upass"))="YourPassword" then<BR> session("Login")="true"<BR> %&#062;<BR><BR> &#060;meta http-equiv="refresh" content="0; url=FirstPageofYouSiteHere.asp"&#062;<BR><BR> &#060;%<BR> Response.End<BR>elseif ucase(Request.Form("uname")) = "" and ucase(Request.Form("upass"))="" then<BR> session("Login")=""<BR> text = ""<BR>else <BR> session("Login")=""<BR> text = "Login Failed, please try again"<BR>end if <BR> %&#062; <BR>&#060;/head&#062;<BR>&#060;body bgcolor="#ffffff" marginheight=0 marginwidth=0 leftmargin=0 topmargin=0&#062;<BR>&#060;cemter&#062;<BR>&#060;% =text%&#062;<BR>&#060;table border=0 cellpadding=0 cellspacing=0&#062;<BR> &#060;tr&#062;<BR> &#060;form name=frm1 action="1st_page.asp" method=post&#062;<BR> &#060;td&#062;Username :&#060;/td&#062;<BR> &#060;td&#062;&#060;input type="text" name="uname"&#062;&#060;/td&#062;<BR> &#060;/tr&#062;<BR> &#060;tr&#062;<BR> &#060;td&#062;Password :&#060;/td&#062;<BR> &#060;td&#062;&#060;input type="password" name="upass"&#062;&#060;/td&#062;<BR> &#060;/tr&#062; &#060;tr&#062;<BR> &#060;td&#062;&nbsp;&#060;/td&#062;<BR> &#060;td&#062;&#060;input type="Submit" value="login" name="btnSubmit"&#062;&#060;/td&#062;<BR> &#060;/form&#062;<BR> &#060;/tr&#062;<BR>&#060;/table&#062;<BR>&#060;/center&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR>HTH.<BR>D.

  3. #3
    Join Date
    Dec 1969
    Posts
    206

    Default RE: How can I password protect my page?

    There are a few approached to this subject. Basically what you do is store usernames and passwords in a data base, and ask the user to enter them before he enters your protected page. After you validate the user, you should store the fact that the user has access to your protected page in a session variable or a cookie, and for each page you need protection, you query the session variable or cookie to find out if the user has permission to view the page.<BR><BR>You should read more about DB access, Cookies and Session variables before you start writing your code.

  4. #4
    Join Date
    Dec 1969
    Posts
    62

    Default RE: Heres a Start

    Thanks!! I try it out.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •