Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2010, 03:38 AM
Authorized User
 
Join Date: Jan 2010
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
Default DB Connection to Login page-

The following code for the log in page -

Code:
<%@LANGUAGE="VBSCRIPT"%> 
<!--#include file="../Connections/collectoz.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("UserID"))
If MM_valUsername <> "" Then
  MM_fldUserAuthorization=""
  MM_redirectLoginSuccess="../ssl/login.htm"
  MM_redirectLoginFailed="loginfailed.asp"
  MM_flag="ADODB.Recordset"
  set MM_rsUser = Server.CreateObject(MM_flag)
  MM_rsUser.ActiveConnection = MM_collectoz_STRING
  MM_rsUser.Source = "SELECT UsrName, Pasword"
  If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
  MM_rsUser.Source = MM_rsUser.Source & " FROM Clients WHERE UsrName='" & Replace(MM_valUsername,"'","''") &"' AND Pasword='" & Replace(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
%>
<%
Dim strUserID
strUserID = "x"
if(Request.Form("UserID") <> "") then strUserID = Request.Form("UserID")
Dim strPassword
strPassword = "1"
if(Request.Form("Password") <> "") then strPassword = Request.Form("Password")
%>
<%
If strUserID <> "x" Then
If Not dbconn.EOF Then
Session("svUser")=dbconn.Fields.Item("Username").Value
Session("svPass")=dbconn.Fields.Item("Password").Value
Response.Redirect "../ssl/login.htm" 
else
Response.Redirect "loginfailed.asp"
End If
End If
%>


<TITLE>Online Services</TITLE>
</head>
<body bgcolor="336699" leftmargin="30" topmargin="0" marginwidth="30" marginheight="0" text="#FFFFFF" link="#FFFFFF" vlink="#CCCCCC" alink="#FFFFFF">
<table bgcolor="#336699" border="0" cellpadding="0" cellspacing="0" width="689" height="8" align="center">
  <tr> 
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="146" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="141" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="16" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="135" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="17" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="101" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="17" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="77" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="64" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr> 
    <td colspan="9"><img src="images/slice01.png" width="714" height="120"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="106" border="0"></td>
  </tr>
  <tr> 
    <td colspan="5"><img name="slice02" src="http://www.collectoz.com/images/slice42.gif" width="455" height="1" border="0"></td>
    <td rowspan="5">&nbsp;</td>
    <td rowspan="2" colspan="3"><img name="slice04" src="http://www.collectoz.com/images/slice44.gif" width="158" height="2" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr> 
    <td rowspan="3"><img src="images/Site%20trafic.png" width="714" height="25"></td>
    <td rowspan="4">&nbsp;</td>
    <td rowspan="3"><img name="slice07" src="../images/slice47.gif" width="16" height="13" border="0"></td>
    <td rowspan="4">&nbsp;</td>
    <td rowspan="3"><img name="slice09" src="../images/slice49.gif" width="17" height="13" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr> 
    <td rowspan="2"><img name="slice10" src="../images/slice50.gif" width="17" height="12" border="0"></td>
    <td height="9">&nbsp;</td>
    <td rowspan="2"><img name="slice12" src="../images/slice52.gif" width="64" height="12" border="0"></td>
    <td height="9"><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="11" border="0"></td>
  </tr>
  <tr> 
    <td><img name="slice13" src="http://www.collectoz.com/images/slice53.gif" width="77" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr> 
    <td rowspan="2" bgcolor="#336699">&nbsp;</td>
    <td rowspan="2" bgcolor="#336699">&nbsp;</td>
    <td rowspan="2" bgcolor="#336699">&nbsp;</td>
    <td rowspan="2" colspan="3" bgcolor="#336699">&nbsp;</td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="2" border="0"></td>
  </tr>
  <td height="13">&nbsp;  
</table>
<table width="714" border="0" cellspacing="0" cellpadding="0" height="143" align="center">
  <tr> 
    <td height="121" valign="top"> 
      <p><font face="Arial, Helvetica, sans-serif"><b>Online Services</b></font></p>
      <p><font size="-1" face="Arial, Helvetica, sans-serif">This is your gateway
           into debtorstocash.com online services. To proceed past this
          point 
        please enter your Login Name and your Password that was issued to you.
           If you would like to register for debtorstocash.com online services
          
        please <a href="../ssl/getauth.asp">click here now</a>. </font></p>
      <form name="loginform" method="POST" action="<%=MM_LoginAction%>">
        <table width="650" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td valign="top" width="214" align="center"> <img src="images/Computer%20Image%20login.png" width="158" height="164"> </td>
            <td width="436" align="center" valign="middle"> <table width="364" border="0">
                <tr> 
                  <td width="104"><font face="Arial, Helvetica, sans-serif" size="-1"> 
                    <b>Login Name:</b></font></td>
                  <td width="250"> <input type=text name=UserID size=32 maxlength=30> 
				  <% Session("MM_Username") = UserID %>
                  </td>
                </tr>
                <tr> 
                  <td width="104"><b><font face="Arial, Helvetica, sans-serif" size="-1">Password:</font></b></td>
                  <td width="250"> <input type=password name=Password size=32 maxlength=30> 
                  </td>
                </tr>
                <tr> 
                  <td width="104"></td>
                  <td width="250"> <input type="submit" name="send" value="    Login    "> 
                    <input type="reset" name="clear" value="    Clear    "> </td>
                </tr>
              </table></td>
          </tr>
        </table>
      </form>
      <p><font face="Arial, Helvetica, sans-serif" size="-1">If you have any
          questions  or problems please contact us via <a href="contactus.htm">e-mail</a> or
           by calling 0447 043 018 during business hours. If you have forgotten
          
        your Login Name/Password or think that they may have been compromised
           please <a href="contactus.htm">contact us </a>immediately.</font></p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
    </td>
  </tr>
</table>
<table width="715" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr> 
    <td><font face="Arial, Helvetica, sans-serif" size="-1">| <a href="../main.asp">Home</a> 
      | <a href="http://www.collectoz.com/content/aboutus.htm">About Us</a> | <a href="http://www.collectoz.com/products.asp">Products &amp; 
      Services</a> | <a href="http://www.collectoz.com/content/online.asp">Online Services</a> | <a href="http://www.collectoz.com/content/contactus.htm">Contact 
      Us</a> | <a href="http://www.collectoz.com/content/jobs.htm">Jobs</a> |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
      <p><font face="Arial, Helvetica, sans-serif" size="-1">Site 
      Designed by Leonard P.O'Grady<br>
    <font size="-2">&copy; Content Copyright 2002 Leonard P.O'Grady
    ABN 80 340 504 889. </font></font></td>
  </tr>
</table>
</body>
</html>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Login multiple db ess100 ASP.NET 2.0 Professional 1 January 16th, 2007 08:18 AM
DB Connection with Application/Page Scope Hazzardusa Classic ASP Databases 0 August 14th, 2005 10:10 PM
Newbie Help. Login to unique login page per user Kainan Classic ASP Professional 10 May 3rd, 2005 07:47 AM
session login with access db surethg Beginning PHP 3 November 19th, 2004 04:34 PM
List of DB login name khautinh SQL Server 2000 2 October 23rd, 2003 03:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.