We are trying to create a login page for our website using DW Ultra Dev4. We have an Access DB of usernames and passwords and we are running IIS 5.0. We would appreciate someone steering us in the right direction for information on how to complete this task or even know of a script that could automate this procedure.
Thanking you.
David Cope
Librarian
Mackillop College
If it is at all useful, this is the code for this page so far:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/Login.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL"
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("username"
)
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="../success.htm"
MM_redirectLoginFailed="../error.htm"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_Login_STRING
MM_rsUser.Source = "SELECT Username, Password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM Accounts WHERE Username='" & MM_valUsername &"' AND Password='" & CStr(Request.Form("password"
) & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username"
= MM_valUsername
If (MM_fldUserAuthorization <> ""
Then
Session("MM_UserAuthorization"
= CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization"
= ""
End If
if CStr(Request.QueryString("accessdenied"
) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied"
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
<!-- #BeginTemplate "/Templates/libmarc.dwt" -->
<head>
<!-- #BeginEditable "doctitle" -->
<title>Untitled Document</title>
<!-- #EndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<table width="100%">
<tr>
<td><font
face=verdana,geneva,arial size=1><b><a
href=" size="2">Books</font></a>
<font size="2"> <a
href=" <a
href=" <a href=" pages</a> <a href=" pages</a></font></b></font>
</td>
</tr>
</table>
<table width="100%">
<tr>
<td><font color=#003366 face=Arial,Helvetica size=6><b>LibraryMarc - <font size="5">cataloguing
the Internet</font><font face="Arial, Helvetica, sans-serif" size="2" color="#0000CC"><a name="#top"></a></font></b></font></td>
</tr>
</table>
<!-- #BeginEditable "content" -->
<form name="form1" method="post" action="<%=MM_LoginAction%>">
<p><b><font face="Arial, Helvetica, sans-serif" size="4" color="#0000A0">Username
<input type="text" username="textfield" maxlength="50" name="username">
</font></b></p>
<p><b><font face="Arial, Helvetica, sans-serif" size="4" color="#0000A0">Password
<input type="password" password="textfield" maxlength="10" name="password">
<input type="submit" name="Submit" value="Submit">
</font></b> </p>
</form>
<!-- #EndEditable -->
<p> </p>
<table width="100%">
<tr bgcolor="#666699">
<td> </td>
</tr>
</table>
<table width="100%">
<tr>
<td>
<div align="center"><font face=geneva,arial size=1><a
href="mailto:libmarc@librarymarc.com.au"><font face="Arial, Helvetica, sans-serif" size="2">Contact
us</font></a> <font face="Arial, Helvetica, sans-serif" size="2"> <a href="../legal.htm">Legal
Notices</a> <a href="../privacy.htm">Privacy policy</a>
<a href="../about.htm">About LibraryMarc</a></font></font>
</div>
</td>
</tr>
</table>
<p> </p>
</body>
<!-- #EndTemplate -->
</html>
Appreciating any help,
David Cope
Librarian
Mackillop College
Thanking you.
David Cope
Librarian
Mackillop College
If it is at all useful, this is the code for this page so far:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/Login.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL"

If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("username"

If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="../success.htm"
MM_redirectLoginFailed="../error.htm"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_Login_STRING
MM_rsUser.Source = "SELECT Username, Password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM Accounts WHERE Username='" & MM_valUsername &"' AND Password='" & CStr(Request.Form("password"

MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username"

If (MM_fldUserAuthorization <> ""

Session("MM_UserAuthorization"

Else
Session("MM_UserAuthorization"

End If
if CStr(Request.QueryString("accessdenied"

MM_redirectLoginSuccess = Request.QueryString("accessdenied"

End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
<!-- #BeginTemplate "/Templates/libmarc.dwt" -->
<head>
<!-- #BeginEditable "doctitle" -->
<title>Untitled Document</title>
<!-- #EndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<table width="100%">
<tr>
<td><font
face=verdana,geneva,arial size=1><b><a
href=" size="2">Books</font></a>
<font size="2"> <a
href=" <a
href=" <a href=" pages</a> <a href=" pages</a></font></b></font>
</td>
</tr>
</table>
<table width="100%">
<tr>
<td><font color=#003366 face=Arial,Helvetica size=6><b>LibraryMarc - <font size="5">cataloguing
the Internet</font><font face="Arial, Helvetica, sans-serif" size="2" color="#0000CC"><a name="#top"></a></font></b></font></td>
</tr>
</table>
<!-- #BeginEditable "content" -->
<form name="form1" method="post" action="<%=MM_LoginAction%>">
<p><b><font face="Arial, Helvetica, sans-serif" size="4" color="#0000A0">Username
<input type="text" username="textfield" maxlength="50" name="username">
</font></b></p>
<p><b><font face="Arial, Helvetica, sans-serif" size="4" color="#0000A0">Password
<input type="password" password="textfield" maxlength="10" name="password">
<input type="submit" name="Submit" value="Submit">
</font></b> </p>
</form>
<!-- #EndEditable -->
<p> </p>
<table width="100%">
<tr bgcolor="#666699">
<td> </td>
</tr>
</table>
<table width="100%">
<tr>
<td>
<div align="center"><font face=geneva,arial size=1><a
href="mailto:libmarc@librarymarc.com.au"><font face="Arial, Helvetica, sans-serif" size="2">Contact
us</font></a> <font face="Arial, Helvetica, sans-serif" size="2"> <a href="../legal.htm">Legal
Notices</a> <a href="../privacy.htm">Privacy policy</a>
<a href="../about.htm">About LibraryMarc</a></font></font>
</div>
</td>
</tr>
</table>
<p> </p>
</body>
<!-- #EndTemplate -->
</html>
Appreciating any help,
David Cope
Librarian
Mackillop College