Can anyone please tell me where i am going wrong? i have built a form for
registering users but i want a message to appear in the header to say if
someone has already logged in with that email address if they input it into the
email field. can any1 see if there is any flaws in the code below? i cant see
anything myself? its baffled me
----------------------------------------------------------------------------------
<cfset bRegistrationSuccess = false />
<cfif isDefined ('FORM.register_button.y')>
<cfquery datasource="stardust" name="qUserCheck">
SELECT *
FROM lcf_user
WHERE email = '#FORM.email#'
</cfquery>
<cfif qUserCheck.RecordCount NEQ 0>
<cfset sHeaderMessage = "Someone has already Registered with that email " />
<cfelse>
<cfquery datasource="stardust" name="qUserType">
SELECT user_type_id
FROM lcf_user_type
WHERE type = 'basic'
</cfquery>
<cfquery datasource="stardust">
INSERT INTO lcf_user (user_id, name_first, name_last, email, password,
sign_up_date, user_type_id)
VALUES ('#CreateUUID()#', '#FORM.name_first#', '#FORM.name_last#',
'#email#', '#FORM.password#', #CreateODBCDateTime(Now())#,
'#qUserType.user_type_id#')
</cfquery>
<cfset bRegistrationSuccess = true />
</cfif>
</cfif><title>User Registration</title>
<cfif NOT bRegistrationSuccess>
<cfinclude template="../../header.cfm" />
<form action="<cfoutput>#CGI.SCRIPT_NAME#</cfoutput>" method="post">
<table>
<tr>
<td colspan="2">
<img src="/images/spacer.gif" height="10" />
</td>
</tr>
<tr>
<td colspan="2" class="ltturq">First Name:</td>
</tr>
<tr>
<td colspan="2" class="turqblue">
<input type="text" name="name_first" class="field" />
</td>
</tr>
<tr>
<td colspan="2">
<img src="/images/spacer.gif" height="10" />
</td>
</tr>
<tr>
<td colspan="2" class="ltturq">Last Name:</td>
</tr>
<tr>
<td colspan="2" class="turqblue">
<input type="text" name="name_last" class="field" />
</td>
</tr>
<tr>
<td colspan="2">
<img src="/images/spacer.gif" height="10" />
</td>
</tr>
<tr>
<td colspan="2" class="ltturq">Email:</td>
</tr>
<tr>
<td colspan="2" class="turqblue">
<input type="text" name="email" class="field" />
</td>
</tr>
<tr>
<td colspan="2">
<img src="/images/spacer.gif" height="10" />
</td>
</tr>
<tr>
<td colspan="2" class="ltturq">Password:</td>
</tr>
<tr>
<td colspan="2" class="turqblue">
<input type="password" name="password" class="field" />
</td>
</tr>
<tr>
<td colspan="2">
<img src="/images/spacer.gif" height="10" />
</td>
</tr>
<tr>
<td colspan="2" class="ltturq">Confirm Password:</td>
</tr>
<tr>
<td class="turqblue">
<input type="password" name="password_confirm" class="field"
/>
</td>
<td>
<input type="image" name="register_button"
src="../images/register.gif" />
</td>
</tr>
<tr>
<td colspan="2">
<img src="/learningcoldfusion/images/spacer.gif" height="10" />
</td>
</tr>
</tr>
<tr>
<td colspan="2">
<img src="/images/spacer.gif" height="10" />
</td>
</tr>
</table>
</form>
<cfinclude template="../../footer.cfm" />
</cfif>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3145
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15