Skip to main content
Participating Frequently
September 14, 2006
Question

Log in User Issues

  • September 14, 2006
  • 3 replies
  • 278 views
In the past I have easily utilized teh Log in User behavior in DW. I am trying to create a basic asp login and I cannot get it to work. I can connect to the DB fine in DW, but when the page is online either it won't come up unless I remove the behavior OR it will come up but won't recognize the correct UN and password.

I then tried to use the Ultrasuite behavior and still no results... I have attached the code to the message. I am not a high level asp person, but have always been able to meet basic needs within dreamweaver.

Thank you,

Jennifer
This topic has been closed for replies.

3 replies

September 15, 2006
Are you using an Oracle database? If so check in the db what the data type is for the password field and then check in DW what the data type is reported as. It must be a varchar2 other wise your login will fail every time.
Inspiring
September 15, 2006
Jennifer

This may not be the issue but 'Password' is now a reserved SQL word on a
number of servers, resulting is syntex errors. Try renaming the field and
the code and see if it works.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"sylar47" <webforumsuser@macromedia.com> wrote in message
news:eebhso$dtv$1@forums.macromedia.com...
> In the past I have easily utilized teh Log in User behavior in DW. I am
> trying
> to create a basic asp login and I cannot get it to work. I can connect to
> the
> DB fine in DW, but when the page is online either it won't come up unless
> I
> remove the behavior OR it will come up but won't recognize the correct UN
> and
> password.
>
> I then tried to use the Ultrasuite behavior and still no results... I have
> attached the code to the message. I am not a high level asp person, but
> have
> always been able to meet basic needs within dreamweaver.
>
> Thank you,
>
> Jennifer
>
>
> <%@LANGUAGE="VBSCRIPT"%>
> <!--#include virtual="/Connections/connActeen2.asp" -->
> <%
> ' UltraSuite_Security_101: Main Login Application
>
> Response.CacheControl = "no-cache"
> Response.AddHeader "pragma", "no-cache"
> Response.Expires = -1500
>
>
>
> Dim rsLogin__strUsername
> rsLogin__strUsername = "1"
> If (Request.Form("txt_username") <> "") Then
> rsLogin__strUsername = Request.Form("txt_username")
> End If
>
>
> Dim rsLogin__strPassword
> rsLogin__strPassword = "1"
> If (Request.Form("txt_password") <> "") Then
> rsLogin__strPassword = Request.Form("txt_password")
> End If
>
>
> Dim rsLogin
> Dim rsLogin_numRows
>
> Set rsLogin = Server.CreateObject("ADODB.Recordset")
> rsLogin.ActiveConnection = MM_connActeen2_STRING
> rsLogin.Source = "SELECT * FROM db_acteen2.tbl_college WHERE Username =
> '" +
> Replace(rsLogin__strUsername, "'", "''") + "' AND Password = '" +
> Replace(rsLogin__strPassword, "'", "''") + "'"
> rsLogin.CursorType = 0
> rsLogin.CursorLocation = 2
> rsLogin.LockType = 1
> rsLogin.Open()
>
> rsLogin_numRows = 0
>
> strRedirectToPreviousPage = ""
>
>
> ' if form has been submitted
> If Request.Form("Submit") <> "" Then
>
> ' and username and password match
> If Not rsLogin.EOF Or Not rsLogin.BOF Then
>
> ' set userid and username fields to session variables
> Session("svUserID") = (rsLogin.Fields.Item("UserID").Value)
> Session("svUserName") = (rsLogin.Fields.Item("Username").Value)
>
> ' if a restricted page has been saved to a session variable
> ' and if user should be redirected to it
> If Session("svProtectedURL") <> "" AND strRedirectToPreviousPage = "true"
> Then
>
> ' redirect to previous URL
> Response.Redirect(cStr(Session("svProtectedURL")))
>
> Else
>
> ' otherwise redirect to the login successful page
> Response.Redirect("alumniONLY.asp")
>
> End If
>
> Else
>
> ' if username and password do not match then redirect to login failed
> page
> Response.Redirect("sorry.asp")
>
> End If
>
> End If
> %>
>


Inspiring
September 14, 2006
It may be the page that you are returning. On that page double click on the recordset and the line below filter should be set to session varable and next to that set to MM_Username. This is a guess may not be your problem.