Passing Parameters from the login screen to another page

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Passing Parameters from the login screen to another page

    Hello All,

    Does anyone know how to pass a login UserID parameter to filter another page?
    Below is my login in screen code. Please advise. Thanks.

    CODE:


    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="Connections/Conn.asp" -->
    <%
    ' *** Validate request to log in to this site.
    MM_LoginAction = Request.ServerVariables("URL")
    If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" +
    Server.HTMLEncode(Request.QueryString)
    MM_valUsername=CStr(Request.Form("Username"))
    If MM_valUsername <> "" Then
    MM_fldUserAuthorization="userGroup"
    MM_redirectLoginSuccess="Assigned.asp"
    MM_redirectLoginFailed="login_Failed.asp"
    MM_flag="ADODB.Recordset"
    set MM_rsUser = Server.CreateObject(MM_flag)
    MM_rsUser.ActiveConnection = MM_Conn_STRING
    MM_rsUser.Source = "SELECT first_Name, pwd, AccountID"
    If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source &
    "," & MM_fldUserAuthorization
    MM_rsUser.Source = MM_rsUser.Source & " FROM dbo.Users WHERE first_Name='" &
    Replace(MM_valUsername,"'","''") &"' AND pwd='" &
    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
    Session("MM_UserID") = (MM_rsUser.Fields.Item("AccountID").Value)
    If (MM_fldUserAuthorization <> "") Then
    Session("MM_UserAuthorization") =
    CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization ).Value)
    Else
    Session("MM_UserAuthorization") = ""
    End If
    'redirect user based on Usergroup level
    if Session("MM_UserAuthorization") = "Sales" then
    MM_redirectLoginSuccess = "sales.asp"
    elseif Session ("MM_UserAuthorization") = "Direct" then
    MM_redirectloginSuccess = "Direct.asp"
    elseif Session ("MM_UserAuthorization") = "HR" then
    MM_redirectloginSuccess = "HR.asp"
    else
    MM_redirectLoginSuccess ="?Action=Failed" 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
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    .style73 { font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 18pt;
    color: #505748;
    }
    -->
    </style>
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0"
    marginheight="0" onload="preloadImages();">
    <td><table id="Table_01" width="100%" height="115" border="0"
    cellpadding="0" cellspacing="0">
    <tr bgcolor="#006531">
    <td></td>
    <td><img src="images/header_2_02.gif" alt="" width="190" height="66"
    border="0" usemap="#Map" /></td>
    <td></td>
    <td><div align="right"><img src="images/header_2_04.gif" width="160"
    height="66" alt="" /></div></td>
    </tr>
    <tr bgcolor="#CEDFB5">
    <td height="23" colspan="4"><p></p></td>
    </tr>
    <tr bgcolor="#B5CF84"> </tr>
    </table>
    <map name="Map" id="Map">
    <area shape="rect" coords="227,77,338,102" href="#" />
    </map></td>
    </tr>
    <tr>
    <td><h1 class="style73">Log In </h1>
    <p>Please log in to access Tracking content.</p></td>
    </tr>
    <p>&nbsp;</p>
    <tr>
    <td><form name="form1" id="form1" method="POST"
    action="<%=MM_LoginAction%>">
    <table width="39%" border="0" align="center">
    <tr>
    <td width="28%">Username</td>
    <td width="72%"><input name="Username" type="text" id="Username"
    /></td>
    </tr>
    <tr>
    <td>Password</td>
    <td><input name="Password" type="text" id="Password" /></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="Submit" value="Submit" /></td>
    </tr>
    </table>
    <p>&nbsp;</p>
    <p>&nbsp; </p>
    </form></td>
    </tr>
    </table>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    </body>
    </html>

    Mike1500 Guest

  2. Similar Questions and Discussions

    1. Passing Parameters To CFC
      I am testing how to return data from a CFC within Flash Forms. I have a simple <cfselect> tag that will hold data returned from a CFC. This CFC...
    2. Login to admin system through login screen only
      Hi there, I have an issue relating to login to my asp.net application. Basically i have built the standard login page which compares against the...
    3. session problem - login screen continually reloads after pressing the login button
      I am trying to get sessions to work on a log in screen to give certain users access to certain pages/directories. The problem is that when the...
    4. Screen Parameters
      -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, 29 Aug 2003 12:15:31 -0500, Tad McClellan wrote: Out of curiosity, what other...
    5. Help Passing Parameters
      Before going to the third script I'd suggest storing the variables in session variables. Here's how I generally do login scripts. Perhaps have...
  3. #2

    Default Re: Passing Parameters from the login screen to anotherpage

    if Session("MM_UserAuthorization") = "Sales" then
    session("username") = request.Form("Username")
    MM_redirectLoginSuccess = "sales.asp"
    elseif Session ("MM_UserAuthorization") = "Direct" then
    session("username") = request.Form("Username")
    MM_redirectloginSuccess = "Direct.asp"
    elseif Session ("MM_UserAuthorization") = "HR" then
    session("username")= request.Form("Username")
    MM_redirectloginSuccess = "HR.asp"
    else

    nisav19 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139