Asp- access

Results 1 to 2 of 2

Thread: Asp- access

  1. #1
    Join Date
    Dec 1969

    Default Asp- access

    I am new to asp.<BR>I am looking for good asp code which authenticates<BR>the user. Basically it should&#039ve a screen which accepts<BR>login id, password and a submit and clear button.<BR>Few validation at the client level like checking not null.<BR><BR>It should check for the id and password in the Access table<BR>and allows users.<BR>Can anyone help.<BR><BR>Mark .<BR>

  2. #2
    Keith Fowler Guest

    Default RE: Asp- access

    You must do a few things for this appraoch to work.<BR><BR>1. You must create the login form that will capture the user&#039s login and password. The ACTION of this form should be the ASP page that will perform the user validation routine. Also, be sure to set the METHOD of the form to &#039POST&#039.<BR><BR>2. Create the validation page that will retrieve the user&#039s info. Then initialize a Session variable to FALSE, or you could place this initialization in the Global.asa, whichever you prefer. Then check the user&#039s info against the database. If the user is Authorized, set a session variable to TRUE.<BR><BR>If (&#039Check if user is authorized) Then<BR> Session("Auth_User") = True<BR> &#039Redirect to the correct page.<BR>Else<BR> &#039Redirect the user to a failure page, or return them to the login page. If you choose the latter, make sure you include some type of code on the login page to let the user know that the login attempt failed.<BR>End If<BR><BR>3. This step is crucial to insure that you maintain some type of security within the other pages of your site. Create an include file that will be included at the top of every page you wish to keep from unauthorized users. The top means before any code you do not want to execute, should the user be unauthorized.<BR><BR>If Not Session("Auth_User") Then<BR> &#039Redirect to your login page<BR>End If<BR><BR>This variable will be destroyed when the Session is abandoned, timedout, or if the user closes his/her browser.<BR><BR>This is not necessairily the best way to protect your site. However, if you are unable to use any other method, this is functional and will serve it&#039s purpose.

Posting Permissions

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