This is a multi-part message in MIME format.
------=_NextPart_000_0023_01BFA810.1DB1D500
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi there, I'm trying to build a password protec system using =
application.cfm and session variables.
I tried the "Guide to Cf logins" (or whatever) from cftutorials Its not =
working, so I tried by my self :
Application.cfm
----------------------
<CFAPPLICATION=20
NAME=3D"MyApplication"
SESSIONMANAGEMENT=3D"Yes"
SESSIONTIMEOUT=3D"#CreateTimeSpan(0,0,45,0)#"=20
APPLICATIONTIMEOUT=3D"#CreateTimeSpan(0,0,45,0)#">
<cfset application.dsn =3D "cadastro">=09
<CFPARAM name=3D"session.LoggedIn" DEFAULT=3D"FALSE">
<!-- If the user is not yet logged in, and not currently on the login =
pages,
or the forgotten password page, -->
<CFIF #session.LoggedIn# IS "FALSE">
<cfif Cgi.scripName IS NOT "cadastro/adm/login.cfm" OR Cgi.ScriptName =
IS NOT "cadastro/adm/validar.cfm">
<cflocation url=3D"../dcad2.html" addtoken=3D"No">
<cfelse>
=20
</cfif>
<cfelse>
</CFIF>
login.cfm
--------------
<form action=3D"validate.cfm" method=3D"POST">
<table>
<tr>
<td><font class=3Dpadrao>Login</td>
<td><input type=3D"Text" name=3D"login" size=3D"10"></td>
</tr>
<tr>
<td><font class=3Dpadrao>Senha</td>
<td><input type=3D"Password" name=3D"pwd" size=3D"10"></td>
</tr>
</table>
<input type=3D"Submit" value=3D"Enviar" class=3D"padrao">
</form>
<cfset session.loggedin =3D false>
validate.cfm
----------------
<cfquery name=3D"checkuser" datasource=3D"#application.dsn#" =
dbtype=3D"ODBC">
SELECT Login, pwd
FROM Usuarios
WHERE Login =3D '#Form.Login#'
AND pwd =3D '#Form.pwd#'
</cfquery>
<cfif checkuser.recordcount GT 0>
<cfset session.loggedin =3D true>
<cflocation url=3D"adm/adm.cfm" addtoken=3D"No">
<cfelse>
<cfset session.loggedin =3D false>
<cflocation url=3D"login.cfm" addtoken=3D"No">
</cfif>
What=B4s happening here is that the system will never a user get in the =
dir adm, even if he enters the correct login/pwd.
Could someone help me please? If you don=B4t want to correct this =
horrible code, please send me one that works
THANKS A LOT GUYS
Vinicius
------=_NextPart_000_0023_01BFA810.1DB1D500
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi there, I'm trying to build a password protec =
system using=20
application.cfm and session variables.</FONT></DIV>
<DIV><FONT size=3D2>I tried the "Guide to Cf logins" (or =
whatever) from=20
cftutorials Its not working, so I tried by my self :</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Application.cfm</FONT></DIV>
<DIV><FONT size=3D2>----------------------</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2><CFAPPLICATION <BR> =20
NAME=3D"MyApplication"<BR> =20
SESSIONMANAGEMENT=3D"Yes"<BR> =20
SESSIONTIMEOUT=3D"#CreateTimeSpan(0,0,45,0)#" =
<BR> =20
APPLICATIONTIMEOUT=3D"#CreateTimeSpan(0,0,45,0)#"></FONT></D=
IV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2><cfset application.dsn =3D=20
"cadastro"> </FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2><BR> <CFPARAM =
name=3D"session.LoggedIn"=20
DEFAULT=3D"FALSE"></FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2> <!-- If the user is not yet logged in, and =
not=20
currently on the login =
pages,<BR> or=20
the forgotten password page, --><BR> <CFIF =
#session.LoggedIn# IS=20
"FALSE"><BR> <cfif Cgi.scripName IS NOT=20
"cadastro/adm/login.cfm" OR Cgi.ScriptName IS NOT=20
"cadastro/adm/validar.cfm"><BR> =20
<cflocation url=3D"../dcad2.html"=20
addtoken=3D"No"><BR> =20
<cfelse><BR> =20
<BR> </cfif><BR> =20
<cfelse><BR> </CFIF></FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>login.cfm</FONT></DIV>
<DIV><FONT size=3D2>--------------</FONT></DIV>
<DIV><FONT size=3D2><form action=3D"validate.cfm"=20
method=3D"POST"><BR><table><BR><tr><BR> <=
;td><font=20
class=3Dpadrao>Login</td><BR> <td><input=20
type=3D"Text" name=3D"login"=20
size=3D"10"></td><BR></tr><BR><tr><BR>&nbs=
p;<td><font=20
class=3Dpadrao>Senha</td><BR> <td><input=20
type=3D"Password" name=3D"pwd"=20
size=3D"10"></td><BR></tr><BR></table><BR>=
<input=20
type=3D"Submit" value=3D"Enviar"=20
class=3D"padrao"><BR></form><BR><cfset =
session.loggedin =3D=20
false></FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>validate.cfm</FONT></DIV>
<DIV><FONT size=3D2>----------------</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2><BR> <cfquery name=3D"checkuser"=20
datasource=3D"#application.dsn#" =
dbtype=3D"ODBC"><BR> =20
SELECT Login, pwd<BR> FROM Usuarios<BR> WHERE Login =3D=20
'#Form.Login#'<BR> AND pwd =3D=20
'#Form.pwd#'<BR> </cfquery></FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2><cfif checkuser.recordcount GT =
0><BR> <cfset=20
session.loggedin =3D true><BR> <cflocation =
url=3D"adm/adm.cfm"=20
addtoken=3D"No"><BR><cfelse><BR><cfset =
session.loggedin =3D=20
false><BR> <cflocation url=3D"login.cfm"=20
addtoken=3D"No"><BR></cfif></FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>What´s happening here is that the system will =
never a=20
user get in the dir adm, even if he enters the correct =
login/pwd.</FONT></DIV>
<DIV><FONT size=3D2>Could someone help me please? If you don´t =
want to=20
correct this horrible code, please send me one that works</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>THANKS A LOT GUYS</FONT></DIV>
<DIV><FONT size=3D2>Vinicius</FONT></DIV></BODY></HTML>
------=_NextPart_000_0023_01BFA810.1DB1D500--
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.