Pass Hidden Field (Rep ID) as Parameter when user logs into site
I have set-up user validation to my site based on a userID and password, but I want to also pass a hidden field/parameter (RepID) to the rest of the site pages so that I can filter my record sets on those pages based on that RepID parameter.
I have coded everything the way I thought it should be, but I'm getting the following error when I test it and from what I can see it is defined...
Element PSWD is undefined in FORM. |
Here is the form coding, as well as the CF coding for the user validation...
...................................................................... ...................................................................... ..
<form id="login" name="login" method="POST" action="<cfoutput>#MM_loginAction#</cfoutput>">
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<td height="35" class="text_bold">Email</td>
<td height="35"><label for="email"></label>
<input type="text" name="email" id="email" /></td>
</tr>
<tr>
<td height="35" class="text_bold">Password</td>
<td height="35"><label for="pswd"></label>
<input name="pswd" type="password" id="pswd" value="<cfoutput>#rsWeblogin#</cfoutput>" /></td>
</tr>
<tr>
<td height="35" class="text_bold"><input name="salesman_id" type="hidden" id="salesman_id" value="<cfoutput>#rsWeblogin.SALESMAN_ID#</cfoutput>" /></td>
<td height="35"><input type="submit" name="submit" id="submit" value="Submit" /></td>
</tr>
</table>
</form>
...................................................................... ...................................................................... ..
<cfparam name="FORM.email" default="1">
<cfquery name="rsWeblogin" datasource="INSORB">
SELECT *
FROM dbo.WEBLOGIN
WHERE E_MAIL = <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="64">
</cfquery>
<cfif IsDefined("FORM.email")>
<cfset MM_redirectLoginSuccess="index.cfm">
<cfset MM_redirectLoginFailed="login.cfm">
<cfquery name="MM_rsUser" datasource="INSORB">
SELECT E_MAIL,PSWD FROM dbo.WEBLOGIN WHERE E_MAIL=<cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="64"> AND PSWD=<cfqueryparam value="#FORM.pswd#" cfsqltype="cf_sql_clob" maxlength="15">
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.email>
<cfset Session.MM_UserAuthorization="">
</cflock>
<cfif IsDefined("URL.accessdenied") AND true>
<cfset MM_redirectLoginSuccess=URL.accessdenied>
</cfif>
<cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
<cfcatch type="Lock">
<!--- code for handling timeout of cflock --->
</cfcatch>
</cftry>
</cfif>
<cflocation url="#MM_redirectLoginFailed#" addtoken="no">
<cfelse>
<cfset MM_LoginAction=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
</cfif>
</cfif>
...................................................................... ...................................................................... ..
Any help would be greatly appreciated!
