Hi there,
I've been working w/ my applation.cfm file and I cannot seem to figure this out.
How do I pass to the next page that is loaded the username that just logged in?
I've got:
<cflogin>
<cfif NOT IsDefined("cflogin")>
<cfinclude template="loginform.cfm">
<cfabort>
<cfelse>
<cfif cflogin.name IS "" OR cflogin.password IS "">
<cfoutput>
<font color="##FF0000" size="3"><strong>You must enter text in both the User Name and Password fields.</font></strong>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
<cfelse>
<cfquery name="loginQuery" dataSource="#application.REM#">
SELECT user_tbl.userAlias, Roles_tbl.Role
FROM user_tbl, Roles_tbl
WHERE
user_tbl.userAlias = Roles_tbl.userAlias AND
user_tbl.UserAlias = '#cflogin.name#'
AND Password = '#cflogin.password#'
</cfquery>
<cfif loginQuery.Role NEQ "">
<cfloginuser name="#cflogin.name#" Password = "#cflogin.password#"roles="">
<!--*****HERE'S WERE I'M TRYING TO SET THE VARIABLE ****-->
<cflock scope = "session" timeout="20" type="exclusive">
<cfset session.username = "#cflogin.name#">
</cflock>
<cfelse>
<cfoutput>
<font color="##FF0000" size="3"><strong>Your login information is
not valid.<br>
Please Try again.</strong></font>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
</cfif>
</cfif>
</cfif>
</cflogin>
I've been working w/ my applation.cfm file and I cannot seem to figure this out.
How do I pass to the next page that is loaded the username that just logged in?
I've got:
<cflogin>
<cfif NOT IsDefined("cflogin")>
<cfinclude template="loginform.cfm">
<cfabort>
<cfelse>
<cfif cflogin.name IS "" OR cflogin.password IS "">
<cfoutput>
<font color="##FF0000" size="3"><strong>You must enter text in both the User Name and Password fields.</font></strong>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
<cfelse>
<cfquery name="loginQuery" dataSource="#application.REM#">
SELECT user_tbl.userAlias, Roles_tbl.Role
FROM user_tbl, Roles_tbl
WHERE
user_tbl.userAlias = Roles_tbl.userAlias AND
user_tbl.UserAlias = '#cflogin.name#'
AND Password = '#cflogin.password#'
</cfquery>
<cfif loginQuery.Role NEQ "">
<cfloginuser name="#cflogin.name#" Password = "#cflogin.password#"roles="">
<!--*****HERE'S WERE I'M TRYING TO SET THE VARIABLE ****-->
<cflock scope = "session" timeout="20" type="exclusive">
<cfset session.username = "#cflogin.name#">
</cflock>
<cfelse>
<cfoutput>
<font color="##FF0000" size="3"><strong>Your login information is
not valid.<br>
Please Try again.</strong></font>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
</cfif>
</cfif>
</cfif>
</cflogin>