Question
CFCPASSWORD is not passed
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">--->
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">--->