can anyone help me with this using vb scripting
using a sql 7 database for validation.
im using dreamweaver ultradev???
help me please
Printable View
can anyone help me with this using vb scripting
using a sql 7 database for validation.
im using dreamweaver ultradev???
help me please
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
Then in every page that you want secure you can putCode: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
Hope this makes senseCode:If Session("LoggedIn") <> "TRUE" Then
'not logged in
response.redirect "Login page"
End If
Ian