Results 1 to 4 of 4

Thread: Password protection with ASP webpages

  1. #1
    Join Date
    Sep 2010
    Posts
    71

    Password protection with ASP webpages

    I have created one website using the ASP.net and this website has lot things to work on. Most importantly, I want to know that how can I restrict the user to access any of my website pages without providing the some amount of data. I meant to say I want to apply Password protection to some of the pages on my website instead of making whole thing password protected. Can somebody tell me how can I do it?

  2. #2
    Join Date
    Apr 2009
    Posts
    488

    Re: Password protection with ASP webpages

    Many people have requirement to protect specific pages on the canvas, as an alternative of entire folders. Using Web server permissions need a couple of things that are out of their hands, and need the cooperation of your hosting service set (NT user accounts, etc). With a database (in this case the access) to accumulate user names and passwords, and access to the database to allow or deny access to the pages in question. If you are having an Expression Web, creating ASP page can be easy. All you have to do is create the ADO data objects, run the query, and use of tags on the server side scripting to create its database column values, if / else conditional, and anything else your imagination and the "magic" takes you to create ASP.

  3. #3
    Join Date
    May 2009
    Posts
    543

    Re: Password protection with ASP webpages

    As a bit of information, I supplemented some "Cookie Dough" in here. For the convenience of its users, who can forget their passwords, you might want to "save" your password information in a cookie, then fill form fields with them. With ASP, this is a simple matter. The request object has a collection of cookies. To fill the form fields with the values of this collection, you must first set the cookie. This is done using the Response object collection of cookies. Important that the page sets the cookie, the code to set the cookie must appear before any HTML code!

  4. #4
    Join Date
    May 2009
    Posts
    637

    Re: Password protection with ASP webpages

    gateway.asp has few ASP code above the HTML code that I have given you as follows.
    Code:
    <% 
    Dim id, password, query, recordset, d 
    
    id = Request.Form ("id") 
    password = Request.Form ("password") 
    
    '** Create your Query 
    query = "SELECT * FROM password WHERE id LIKE '" & _ 
    id & "'AND password LIKE'" & password & "'" 
    
    '** Create a RecordSet to store the results of the query 
    Set recordset = Server.CreateObject ("ADODB.Recordset") 
    recordset.Open query, "DSN = xxxxxx;" 
    
    '** Check for no records returned (id or password not found) 
    then if NOT recordset.EOF 
    
    '** Set cookies for user's convenience 
    d = Date 
    Response.Cookies ("userid") = id 
    Response.Cookies ("pword") = password 
    Response.Cookies ("userid"). Expires = DateAdd ("yyyy", 2, d) 
    Response.Cookies ("pword"). Expires = DateAdd ("yyyy", 2, d) 
    end if 
    %> 
    <html>
    In this page, the form fields are populated with a bit of simple ASP code on example of Which follows:

    Code:
    <Input type = "text" size = "20" name = "password" value = "<% = Request.Cookies (" pword ")%>">
    Note: for the purposes of security, you may not want to store the password in a cookie. However, storing the user ID can be convenient.

Similar Threads

  1. Password protection not in Android Market
    By fAROK in forum Portable Devices
    Replies: 5
    Last Post: 02-07-2011, 10:11 AM
  2. Password protection on router
    By NewComer in forum Networking & Security
    Replies: 4
    Last Post: 22-03-2010, 04:11 PM
  3. How to use Keepass for Password protection
    By DeMario in forum Windows Software
    Replies: 5
    Last Post: 12-01-2010, 04:04 AM
  4. OpenOffice Password Protection
    By Woodrow in forum Windows Software
    Replies: 3
    Last Post: 18-03-2009, 02:25 PM
  5. Password Protection for Files
    By Ayush in forum Windows Software
    Replies: 5
    Last Post: 03-01-2009, 02:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,123,012.36056 seconds with 17 queries