sign-up form

pass variables to the right locations

Page 1 of 1

6 Replies - 2457 Views - Last Post: 08 May 2006 - 05:30 PM Rate Topic: -----

#1 chipshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 30-April 06

sign-up form

Posted 07 May 2006 - 12:06 PM

I need to create a sign up for membership form where if someone signs up as a basic membership (A-free) they would simply be directed to the sign in page but if they choose membership (B-pay) they would be directed to (cartweaver) shopping cart / pay then be directed back to the sign in page. And also pass all sign-up info into the database.

What would be the best way to accomplish this?
Is This A Good Question/Topic? 0
  • +

Replies To: sign-up form

#2 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4503
  • View blog
  • Posts: 28,411
  • Joined: 21-March 01

Re: sign-up form

Posted 08 May 2006 - 11:52 AM

well, based on the info your giving, i would assume that your having them pick their membership type with a radio button

so on your next page, you could do a simple cfif

<cfif membershipType = 'A'>
   <cflocation url="placetogoA.cfm">
<cfelseif membershipType = 'B'>
   <cflocation url="placetogoB.cfm">
</cfif>


Was This Post Helpful? 0
  • +
  • -

#3 chipshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 30-April 06

Re: sign-up form

Posted 08 May 2006 - 12:27 PM

<cfif membershipType = 'A'>
<cflocation url="placetogoA.cfm">
<cfelseif membershipType = 'B'>
<cflocation url="placetogoB.cfm">
</cfif>

Is membershipType a coldfusion tag? Or do I need to put that variable in my form?
Also once membershipType = 'B' is directed to the OrderForm page in cartweaver how can I verify that payment has been made and direct them to the login page?


Thank You,
Chipshot
Was This Post Helpful? 0
  • +
  • -

#4 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4503
  • View blog
  • Posts: 28,411
  • Joined: 21-March 01

Re: sign-up form

Posted 08 May 2006 - 02:29 PM

membershipType would be the variable name of your radio buttons, for example on a page i'm working on at the moment i have this

<input type="radio" name="approved" value="1">Yes<br>
<input type="radio" name="approved" value="0">No<br>



and on the next page I can view the answer by acessing #form.approved# or i can do an if on it like the following

<cfif #form.approved# is "1">
Thank You!
<cfelseif #form.approved# is "0">
Sorry, you were not approved
</cfif>



unfortunately i have no idea how to tell you if they paid or not, you may need to contact the developers of the cart software you are using.
Was This Post Helpful? 0
  • +
  • -

#5 chipshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 30-April 06

Re: sign-up form

Posted 08 May 2006 - 03:00 PM

Maybe if I show you the code it would make a little more sense to you. I would prefer the drop down box though.

Thank You for your help...
Chipshot

I get an error with the cfif statement custtype_ID

///Invalid CFML construct found on line 5 at column 19.
a cfif tag beginning on line 5, column 2.
5 : <cfif custtype_ID = '5, 6, 7'>
6 : <cflocation url="/member_center/index.cfm">
7 : <cfelseif custtype_ID = '2'>
////

custtypes_ID 5,6,7 refer to a basic membership
custtype_ID '2' is the one I need to go through the payment before access to certain areas of the site...

Here is the code from the registration page...

<cfquery datasource="request.dsn" name="GetCustInfo">
INSERT INTO tbl_customers (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 ('#Form.FirstName#', '#Form.LastName#', '#Form.Address1#', '#Form.Address2#', '#FORM.City#', '#Form.State#', '#FORM.Zip#', '#FORM.Phone#', '#FORM.MobilePhone#', '#FORM.Username#', '#Form.Password#',)
</cfquery>
<cfif custtype_ID = '5, 6, 7'>
<cflocation url="/member_center/index.cfm">
<cfelseif custtype_ID = '2'>
<cflocation url="OrderForm.cfm">
</cfif>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"



<p class="h1">Member Center: Registration
</h1>
</p>
<h3>Registering as a Final Touch Golf Member is easy! <br>
</h3>
<p> Your Final Touch Golf Member account stores all of your contact and shipping information so that you can quickly and easily order products from us online or via phone. Here you can manage your email address, your shipping and mailing addresses, as well as sign up for our Internet home lesson program and our weekly e-Tips golf tip email.

Once you've created a Final Touch Golf member account, you can log in to our site at any time using your Username and Password. </p>
<p><span class="subhead">Sign up for our Internet home lesson plan for $34.95/month and your first month will be FREE!<br>
</span><span class="medium">you will be billed just a one-time activation fee of $29.95</span></p>
<p><span class="medium">You will then receive an e-mail confirmation with your Username and Password. And have immediate access to upload swing videos to our on-line analysis program. click here to view a <a href="/sample_analysis.cfm">sample online lesson.</a> You will also have access to view our library over 100 swings from the PGA and LPGA tours, as well as our e-mail golf tips sent to your inbox about once every other week.</span><span class="subhead"> <br class="p">
</span> </p>
<h3>Register for Web-Only Benefits</h3>
<p align="left">Please complete the fields below to register with finaltouchgolf.com. Registration will give you access to member only features such as<br>
the internet home lesson plan, and viewing your previous submitted golf swing files and past internet lessons. <br>
And receive e-mail alerts on upcoming events, specials etc.</p>
<h3><span class="tdred">*</span> Required Fields</h3>
<form action="member_center/index.cfm" 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" value="" size="25"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td"><span class="tdred">*</span>Password:</td>
<td><input type="password" name="Password" value="" size="20"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td"><span class="tdred">*</span>Confirm Password:</td>
<td><input type="password" name="ConfirmPassword" value="" size="20"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">First Name:</td>
<td><input type="text" name="FirstName" value="" size="25"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td"><span class="tdred">*</span>Last Name:</td>
<td><input type="text" name="LastName" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">Street Address:</td>
<td><input type="text" name="Address1" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">Address 2:</td>
<td><input type="text" name="Address2" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">City:</td>
<td><input type="text" name="City" value="" size="20"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">State:</td>
<td><select name="State" style="width:200">
<option>-Select State</option>
<option>Alabama</option>
<option>Alaska</option>
<option>Arizona</option>
<option>Arkansas</option>
<option>California</option>
<option>Colorado</option>
<option>Connecticut</option>
<option>Delaware</option>
<option>District of Columbia</option>
<option>Florida</option>
<option>Georgia</option>
<option>Hawaii</option>
<option>Idaho</option>
<option>Illinois</option>
<option>Indiana</option>
<option>Iowa</option>
<option>Kansas</option>
<option>Kentucky</option>
<option>Louisiana</option>
<option>Maine</option>
<option>Maryland</option>
<option>Massachusetts</option>
<option>Michigan</option>
<option>Minnesota</option>
<option>Mississippi</option>
<option>Missouri</option>
<option>Montana</option>
<option>Nebraska</option>
<option>Nevada</option>
<option>New Hampshire</option>
<option>New Jersey</option>
<option>New Mexico</option>
<option>New York</option>
<option>North Carolina</option>
<option>North Dakota</option>
<option>Ohio</option>
<option>Oklahoma</option>
<option>Oregon</option>
<option>Pennsylvania</option>
<option>Rhode Island</option>
<option>South Carolina</option>
<option>South Dakota</option>
<option>Tennessee</option>
<option>Texas</option>
<option>Utah</option>
<option>Vermont</option>
<option>Virginia</option>
<option>Washington</option>
<option>West Virginia</option>
<option>Wisconsin</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" value="" mask="99999-9999" size="10"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">Home Phone:</td>
<td><input type="text" name="Phone" value="" size="14"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td">Mobile Phone:</td>
<td><input type="text" name="MobilePhone" value="" size="14"></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap class="td"><span class="tdred">*</span>Email Address:</td>
<td><input type="text" name="Email" value="" size="32"></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">&nbsp;</td>
<td><select name="UserTypeID">
<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">&nbsp;</td>
<td><input type="submit" class="td" value="Register"></td>
</tr>
</table>
<p>
<input type="hidden" name="MM_InsertRecord" value="form1">
</form>
Was This Post Helpful? 0
  • +
  • -

#6 supersloth  Icon User is offline

  • serial frotteur - RUDEST MEMBER ON D.I.C.
  • member icon


Reputation: 4503
  • View blog
  • Posts: 28,411
  • Joined: 21-March 01

Re: sign-up form

Posted 08 May 2006 - 03:06 PM

your getting the error because you can't do an if like 5,6,7 you have to do

<cfif custtype_ID = '5' or custtype_ID = '6' or custtype_ID = '7'>

and you can do a drop down menu just as easily, the syntax is always the same #form.variablename#
Was This Post Helpful? 0
  • +
  • -

#7 chipshot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 30-April 06

Re: sign-up form

Posted 08 May 2006 - 05:30 PM

I got past the last issue now I get this error message...


I do not have cst_ID set to AutoNumber, it's set to text/Yes(NO Duplicates) but it is the primary Key. Should'nt #CreateUUID()#,
create the cst_ID for me?

Here's the error message..

Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver]
The changes you requested to the table were not successful because they would create duplicate
values in the index, primary key, or relationship. Change the data in the field or fields that
contain duplicate data, remove the index, or redefine the index to permit duplicate entries
and try again.

The error occurred in C:\CFusionMX7\wwwroot\register\user_registration.cfm: line 6

4 : <cfquery datasource="#request.dsn#">
5 : 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)
6 : 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#)
7 : </cfquery>
8 : </cfif>

Thank You,
You guys are great
Chipshot

This post has been edited by chipshot: 08 May 2006 - 10:40 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1