Trying to create a registration form for my site
Can You tell me why I get this error?
Thank You in advance for you much needed assistance!
Chipshot
Variable CREATEUUID is undefined.
The error occurred in C:\CFusionMX7\wwwroot\register\user_registration.cfm: line 4
2 : <cfquery datasource="#request.dsn#">
3 : INSERT INTO tbl_customers(cst_ID, cst_FirstName, cst_LastName, cst_Address1, cst_Address2,
cst_City, cst_State, cst_Zip, cst_Phone, cst_MobilePhone, cst_Username, cst_Password, cst_Type_ID)
4 : VALUES('#CreateUUID#', '#Form.FirstName#', '#Form.LastName#', '#Form.Address1#',
'#Form.Address2#', '#FORM.City#', '#Form.State#', '#FORM.Zip#', '#FORM.Phone#',
'#FORM.MobilePhone#', '#FORM.Username#', '#Form.Password#', #FORM.cst_Type_ID#)
5 : </cfquery>
6 : </cfif>
Here's some of the database fields...
FieldName:/cst_ID Data Type:/text {Required:/Yes Indexed:/Yes(No Duplicates) Primary Key with relationships}
FieldName:/cst_Type_ID DataType:/Number {Long Integer Default Value/1 Required:/No }
Here's the entire page if you need to see it minus the unnessaries...
<cfif IsDefined('FORM.register_btn')>
<cfquery datasource="#request.dsn#">
INSERT INTO tbl_customers(cst_ID, cst_FirstName, cst_LastName, cst_Address1, cst_Address2, cst_City, cst_State, cst_Zip, cst_Phone, cst_MobilePhone, cst_Username, cst_Password, cst_Type_ID)
VALUES('#CreateUUID#', '#Form.FirstName#', '#Form.LastName#', '#Form.Address1#', '#Form.Address2#', '#FORM.City#', '#Form.State#', '#FORM.Zip#', '#FORM.Phone#', '#FORM.MobilePhone#', '#FORM.Username#', '#Form.Password#', #FORM.cst_Type_ID#)
</cfquery>
</cfif>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<p class="h1">Member Center: Registration
</h1>
<form action="<cfoutput>#CGI.SCRIPT_NAME#</cfoutput>" method="Post">
<table bordercolor="#013302">
<tr valign="baseline">
<td align="right" nowrap class="td"><span class="tdred">*</span>Username:</td>
<td><input type="text" name="Username" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td"><span class="tdred">*</span>Password:</td>
<td><input type="password" name="Password" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td"><span class="tdred">*</span>Confirm Password:</td>
<td><input type="password" name="Password2" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">First Name:</td>
<td><input type="text" name="FirstName" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td"><span class="tdred">*</span>Last Name:</td>
<td><input type="text" name="LastName" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">Street Address:</td>
<td><input type="text" name="Address1" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">Address 2:</td>
<td><input type="text" name="Address2" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">City:</td>
<td><input type="text" name="City" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">State:</td>
<td><select name="State">
<option selected>-Select State</option>
<option>Wyoming</option>
</select></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">Postal Code:</td>
<td><input type="text" name="Zip" mask="99999-9999" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">Home Phone:</td>
<td><input type="text" name="Phone" mask="999-999-9999" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">Mobile Phone:</td>
<td><input type="text" name="MobilePhone" mask="999-999-9999" /></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td"><span class="tdred">*</span>Email Address:</td>
<td><input type="text" name="Email" /></td>
</tr>
<tr valign="baseline">
<td colspan="2" align="right" nowrap class="td"><div align="left"><span class="tdred">*</span>Please Choose Membership Type:</div></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td"> </td>
<td><select name="cst_Type_ID">
<option value="2" >Internet Home Lesson Plan</option>
<option value="7">Basic Membership</option>
</select>
<br>
</td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td"> </td>
<td><input name="register_btn" type="submit" class="td" value="Register" />
</tr>
</table>
<p>
</form>
</body>
</html>
registration formI just can't seem to get it right
Page 1 of 1
6 Replies - 2387 Views - Last Post: 10 May 2006 - 02:09 PM
Replies To: registration form
#2
Re: registration form
Posted 10 May 2006 - 12:48 PM
you don't have an input named CREATEUUID anywhere in your form, thats why its undefined.
#4
Re: registration form
Posted 10 May 2006 - 01:14 PM
i dunno, i guess that depends on what your trying to use it for.
#5
Re: registration form
Posted 10 May 2006 - 01:22 PM
Go simply give each new registant a unique cst_ID
This post has been edited by chipshot: 10 May 2006 - 01:26 PM
#6
Re: registration form
Posted 10 May 2006 - 01:26 PM
If I don't add that in the query I get :
The field 'tbl_customers.cst_ID' cannot contain a Null value because the Required property for this field is set to True. Enter a value in this field.
The field 'tbl_customers.cst_ID' cannot contain a Null value because the Required property for this field is set to True. Enter a value in this field.
#7
Re: registration form
Posted 10 May 2006 - 02:09 PM
you can't just remove it, the table needs a value, you should either make the field an auto increment so it figures the id out on its own, or you need to assign the variable a value, either thru some sort of user input or setting it as a hidden field.
you need to break your problem down and figure everything out based on the problem
--what information do you need?
--how are you going to get it?
--where are you going to put it?
then design a solution that best meets those needs, throwing code around and removing variables cause they dont work isn't going to get you a viable, working solution.
you need to break your problem down and figure everything out based on the problem
--what information do you need?
--how are you going to get it?
--where are you going to put it?
then design a solution that best meets those needs, throwing code around and removing variables cause they dont work isn't going to get you a viable, working solution.
Page 1 of 1
|
|

New Topic/Question
This topic is locked



MultiQuote





|