Results 1 to 2 of 2

Thread: Password Validation for members Area

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    81
    can anyone help me with this using vb scripting

    using a sql 7 database for validation.
    im using dreamweaver ultradev???
    help me please


  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi Johnny23

    you need to do this in several stages.

    First of all in SQL, create a table called login with a username and password field.

    Write a page like the following

    <FORM action="login.asp" method="Post">
    <INPUT type="TEXT" name="username"><br>
    <INPUT type="TEXT" name="Password">
    </FORM>

    then create login.asp with the following

    Code:
    Dim objCon
    Dim objLoginRec
    Dim strSQL
    Dim strUsername
    Dim strPassword
    
    Set objCon = Server.createObject("ADODB.Connection")
    Set objLoginRec = Server.createObject("ADODB.Recordset")
    
    strUsername = Request.Form("username")
    strPassword = Request.Form("Password")
    
    
    
    objCon.Open 'insert your connection string here
    
    
    strSQL = "SELECT * FROM login WHERE username = '" & strUsername & "' AND password = '" &  strPassword & "'"
    
    objLoginRec.Open strSQL,objCon,adopenstatic
    
    If objLoginRec.BOF AND objLoginRec.EOF Then
    'No record found
    'put in code to try again
    Else
     Session("LoggedIn") = "TRUE"
    End IF
    Then in every page that you want secure you can put
    Code:
    If Session("LoggedIn") <> "TRUE" Then
      'not logged in
      response.redirect "Login page"
    End If
    Hope this makes sense

    Ian

    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

Posting Permissions

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



Click Here to Expand Forum to Full Width