Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
nabil m #1
simple login form
hi i am using vs.net with csharp -
i am trying to create a simple log in form
user id
password
on submit i run a param query to check if the userid and password exist if
yes i
would like to store to the contactusername in a session and rediret the user
to another page -
q: how do i check if the param select query returned a record and how do i
access the userid from my sql query to store it in a session("sessUserId")
thx
nabil m Guest
-
Main form and login form in different folders using Forms Authen
Having a problem on my site when the login form and the main form are in different apps. When the main app redirects to the login form app,... -
Simple login script?
Hello, I wonder if anyone can help me with a very simple login procedure? I have a database (DSN name is mydsn) with fields "username1" and... -
SImple portal login
Hi, Are there any tutorials on how to create a simple user login? Thanks -
php login and simple connect
Hi, JeffreyGong I'm Giuseppe and I'm interested in your website about flashcom! Coule you send me some source code for study? Thank you very... -
A simple problem with a really simple form
Hi there, I'm having a problem with designing a very small form in Dreamweaver. Its just a login form with username and password textfields - the... -
nabil m #2
simple login form
hi i am using vs.net with csharp -
i am trying to create a simple log in form
user id
password
on submit i run a param query to check if the userid and password exist if
yes i
would like to store to the contactusername in a session and rediret the user
to another page -
q: how do i check if the param select query returned a record and how do i
access the userid from my sql query to store it in a session("sessUserId")
thx
nabil m Guest
-
amystephenson #3
Simple Login Form
I followed the login sample and for some reason once I have logged in it
doesn't recognize my username and password. I have typed them exactly as they
are in the database.
Heres the code:
<cfif IsDefined("FORM.txtUserName")>
<cfset MM_redirectLoginSuccess="products.htm">
<cfset MM_redirectLoginFailed="registration.cfm">
<cfquery name="MM_rsUser" datasource="BYSRep">
SELECT Username,password FROM login WHERE Username='#FORM.txtUserName#' AND
password='#FORM.txtPassword#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.txtUserName>
<cfset Session.MM_UserAuthorization="">
</cflock>
<cfif IsDefined("URL.accessdenied") AND false>
<cfset MM_redirectLoginSuccess=URL.accessdenied>
</cfif>
<cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
<cfcatch type="Lock"><!--- code for handling timeout of cflock --->
</cfcatch>
</cftry>
</cfif>
<cflocation url="#MM_redirectLoginFailed#" addtoken="no">
<cfelse>
<cfset MM_LoginAction=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
</cfif>
</cfif>
I keep getting the redirect failed page for some reason.
Thanks, Amy
<cfif IsDefined("FORM.txtUserName")>
<cfset MM_redirectLoginSuccess="products.htm">
<cfset MM_redirectLoginFailed="registration.cfm">
<cfquery name="MM_rsUser" datasource="BYSRep">
SELECT Username,password FROM login WHERE Username='#FORM.txtUserName#' AND
password='#FORM.txtPassword#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.txtUserName>
<cfset Session.MM_UserAuthorization="">
</cflock>
<cfif IsDefined("URL.accessdenied") AND false>
<cfset MM_redirectLoginSuccess=URL.accessdenied>
</cfif>
<cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
<cfcatch type="Lock"><!--- code for handling timeout of cflock --->
</cfcatch>
</cftry>
</cfif>
<cflocation url="#MM_redirectLoginFailed#" addtoken="no">
<cfelse>
<cfset MM_LoginAction=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
</cfif>
</cfif>
amystephenson Guest
-
amystephenson #4
Re: Simple Login Form
I coule still use some help on this issue. Please
amystephenson Guest
-
gwgiswebmaster #5
Re: Simple Login Form
i had posted a reply yesterday but it disappeared :confused; anyway - try
replacing your <cflocation> tags with a javascript window.location command
instead. <cflocation> tends to override all other code
gwgiswebmaster Guest
-
externalError #6
Re: Simple Login Form
Originally posted by: amystephenson
I coule still use some help on this issue. Please
Hi,
You code is correct, I'm not sure what's wrong but try one of these:
1) Open the database table and see if the table really has the login
information that you types in the form
2) Use the Trim() function in your SQL statement as the following: SELECT
Username,password FROM login WHERE Username='#trim(FORM.txtUserName)#' AND
password='#trim(FORM.txtPassword)#'
3) In your Application.cfm file, increase the session time out, something like
this: <cfapplication name="myApplication" sessionmanagement="yes"
sessiontimeout="#createTimeSpan(0,0,20,0)#">
4) Remove the CFLock code
If nothing of the above solves the problem, then there must be some bug that
I'm not aware about in your code :)
Goodluck
externalError Guest
-
OldCFer #7
Re: Simple Login Form
Are you getting any records? Is the cflock error happening? If so it
will fall through to the :
<cflocation url="#MM_redirectLoginFailed#" addtoken="no">
line. Where does URL.accessdenied come from. It really has no use
because <cfif IsDefined("URL.accessdenied") AND false> is always
false so URL.accessdenied is never used.
OldCFer Guest



Reply With Quote

