Skip to main content
Inspiring
May 14, 2006
Question

CFCPASSWORD is not passed

  • May 14, 2006
  • 1 reply
  • 332 views
I get the following error which is says CFCPASSWORD is not passed. Why not? Thanks:

The parameter CFCPASSWORD to function adduser is required but was not passed in.

The error occurred in C:\CFusionMX7\wwwroot\CFIDE\REGISTERING\index.cfm: line 27

25 : method="adduser"
26 : returnVariable="adduser"
27 : cfcUsername="#form.username#">
28 : cfcPassword="#form.password#">
29 : <cfset adduser="#adduser#">

register.cfc
<cfcomponent>
<cffunction access="public" name="adduser" output="0">
<!--- add new user function --->
<!--- username and password required --->
<cfargument name="cfcUsername" type="string" required="1" />
<cfargument name="cfcPassword" type="string" required="1" />

<cfset variables.verificationKey = CreateUUID()>

<!--- query the SecurityDB for the passed username --->
<cfquery name="checkusername" datasource="SecurityDB" username="root" password="riveravon">
SELECT username
FROM Security
WHERE username = '#arguments.cfcUsername#'
</cfquery>


<cfif checkusername.recordCount>
<cfreturn checkusername.recordCount />
<cfelse>
<cfquery name="newUser" datasource="SecurityDB" username="root" password="riveravon">
INSERT INTO security (username, password, activationcode)
VALUES ('#form.username#', '#form.password#', '#variables.verificationKey#')
</cfquery>

<cfreturn 0 />
</cfif>
</cffunction>
</cfcomponent>

index.cfm
<cfif structKeyExists(form,"adduser")>
<!--- User pressed the register insert button --->
<cfinvoke
component="register"
method="adduser"
returnVariable="adduser"
cfcUsername="#form.username#">
cfcPassword="#form.password#">
<cfset adduser="#adduser#">
</cfif>

<cfdump var = "#variables#">
<cfif isDefined("variables.adduser")>
<cfif variables.adduser NEQ 0>
<b>This Username already exists! Please enter another</b>
<cfelse>
<cflocation url="activation.cfm" addtoken="No">
</cfif>
</cfif>

<form name="adduser" method="post" action="index.cfm">
<DIV align=center>Email:
<INPUT class=camporegister name=username>
<br>
Password:
<INPUT class=camporegister name=password></DIV>
<input tabindex="3" type="Submit" name="adduser" class="ftforminputsmall">
</DIV></form>

<!--- this image as a submit button causes errors so changed it to above--->
<!---<input tabindex="3" type="image" name="adduser" src="images/register.gif" height=43 width=164 border="0">--->
This topic has been closed for replies.

1 reply

Inspiring
May 14, 2006
You're cfinvoke closing tag comes on line 27. You attempt to send the password on line 28.

Line 29 appears to be redundant.
Inspiring
May 14, 2006
Thanks a lot Dan that works great now. I set the variable because I thought that was needed but I took it out. I`m going to try another cfc now see if I can get it right first time, thanks again

<cfif structKeyExists(form,"adduser")>
<!--- The user pressed the register insert button --->
<cfinvoke
component="register"
method="adduser"
returnVariable="adduser"
cfcUsername="#form.username#"
cfcPassword="#form.password#">

</cfif>