On Thursday, Aug 14, 2003, at 10:41 US/Pacific, Davis, Eric wrote:
My user.cfc and login/process.cfm don't work well, regardless.

Now we see the code, we can point out the error:


������� <cffunction name="login" hint="Log the user into system" returntype="boolean" output="No">
������� ������� <cfargument name="username" required="Yes" type="string" />
������� ������� <cfargument name="password" required="Yes" type="string" />
[snip]
������� ������� ������� username = arguments.username;

You have a name conflict between the unnamed scope and the arguments scope here - and arguments scope takes precedence! That means the above statement is equivalent to:


arguments.username = arguments.username;

i.e., it doesn't do anything.

You have two choices:
1. Upgrade to CFMX 6.1 and use "variables" scope for non-public data (recommended)
2. Use the "instance" idiom:


        <!--- in pseudo-constructor --->
        <cfset instance = structNew()>

        <!--- in code --->
        <cfset instance.username = arguments.username>

(and use "instance." everywhere instead of the unqualified scope).

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

Reply via email to