Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Currently logged in

Status
Not open for further replies.

vionca

MIS
Nov 19, 2003
60
US
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>
 
You'll probably need to give more information about your problem. What exactly is happening? Are you getting an error? How much of the above code is working?

Just looking at the code above, I can take a wild guess. I'm not exactly sure where you're getting this from, "cflogin.name", but you should probably change the scope of your variables to "Form" instead of "cflogin". "cflogin" is not a legitmate ColdFusion scope (unless you've created it.) So instead of referencing "cflogin.name" and "cflogin.password" try "form.name" and "form.password"



Hope This Helps!

Ecobb

&quot;My work is a game, a very serious game.&quot; - M.C. Escher
 
I apologize for not being clear. I think this is what I need, silly me:

GetAuthUser()

Sorry to trouble you! But your help is always appreciated!

Vionca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top