Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a login page

Status
Not open for further replies.

tigger19

Technical User
Mar 18, 2001
4
AU
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=&quot;VBSCRIPT&quot;%>
<!--#include file=&quot;../Connections/Login.asp&quot; -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables(&quot;URL&quot;)
If Request.QueryString<>&quot;&quot; Then MM_LoginAction = MM_LoginAction + &quot;?&quot; + Request.QueryString
MM_valUsername=CStr(Request.Form(&quot;username&quot;))
If MM_valUsername <> &quot;&quot; Then
MM_fldUserAuthorization=&quot;&quot;
MM_redirectLoginSuccess=&quot;../success.htm&quot;
MM_redirectLoginFailed=&quot;../error.htm&quot;
MM_flag=&quot;ADODB.Recordset&quot;
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_Login_STRING
MM_rsUser.Source = &quot;SELECT Username, Password&quot;
If MM_fldUserAuthorization <> &quot;&quot; Then MM_rsUser.Source = MM_rsUser.Source & &quot;,&quot; & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & &quot; FROM Accounts WHERE Username='&quot; & MM_valUsername &&quot;' AND Password='&quot; & CStr(Request.Form(&quot;password&quot;)) & &quot;'&quot;
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(&quot;MM_Username&quot;) = MM_valUsername
If (MM_fldUserAuthorization <> &quot;&quot;) Then
Session(&quot;MM_UserAuthorization&quot;) = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session(&quot;MM_UserAuthorization&quot;) = &quot;&quot;
End If
if CStr(Request.QueryString(&quot;accessdenied&quot;)) <> &quot;&quot; And false Then
MM_redirectLoginSuccess = Request.QueryString(&quot;accessdenied&quot;)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
<!-- #BeginTemplate &quot;/Templates/libmarc.dwt&quot; -->
<head>
<!-- #BeginEditable &quot;doctitle&quot; -->
<title>Untitled Document</title>
<!-- #EndEditable -->
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>
<body bgcolor=&quot;#FFFFFF&quot;>
<table width=&quot;100%&quot;>
<tr>
<td><font
face=verdana,geneva,arial size=1><b><a
href=&quot; size=&quot;2&quot;>Books</font></a>
<font size=&quot;2&quot;> <a
href=&quot; <a
href=&quot; <a href=&quot; pages</a> <a href=&quot; pages</a></font></b></font>
</td>
</tr>
</table>
<table width=&quot;100%&quot;>
<tr>
<td><font color=#003366 face=Arial,Helvetica size=6><b>LibraryMarc - <font size=&quot;5&quot;>cataloguing
the Internet</font><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot; color=&quot;#0000CC&quot;><a name=&quot;#top&quot;></a></font></b></font></td>
</tr>
</table>
<!-- #BeginEditable &quot;content&quot; -->
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;<%=MM_LoginAction%>&quot;>
<p><b><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;4&quot; color=&quot;#0000A0&quot;>Username
<input type=&quot;text&quot; username=&quot;textfield&quot; maxlength=&quot;50&quot; name=&quot;username&quot;>
</font></b></p>
<p><b><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;4&quot; color=&quot;#0000A0&quot;>Password
<input type=&quot;password&quot; password=&quot;textfield&quot; maxlength=&quot;10&quot; name=&quot;password&quot;>
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;>
</font></b> </p>
</form>
<!-- #EndEditable -->
<p> </p>
<table width=&quot;100%&quot;>
<tr bgcolor=&quot;#666699&quot;>
<td> </td>
</tr>
</table>
<table width=&quot;100%&quot;>
<tr>
<td>
<div align=&quot;center&quot;><font face=geneva,arial size=1><a
href=&quot;mailto:libmarc@librarymarc.com.au&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;>Contact
us</font></a> <font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;> <a href=&quot;../legal.htm&quot;>Legal
Notices</a> <a href=&quot;../privacy.htm&quot;>Privacy policy</a>
<a href=&quot;../about.htm&quot;>About LibraryMarc</a></font></font>
</div>
</td>
</tr>
</table>
<p> </p>
</body>
<!-- #EndTemplate -->
</html>

Appreciating any help,
David Cope
Librarian
Mackillop College
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top