Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
trying to send form information via <cfhttp>
Old 12-02-2009, 03:10 PM trying to send form information via <cfhttp>
ericson3000's Avatar
Experienced Talker

Posts: 40
Name: Bob Davis
Location: Los Angeles, CA
Trades: 0
Hey guys, I have a ColdFusion question.

I have a simple form where a customer infputs their name and email address. The action takes the customer to a secondary page where I use <cfmail> emails them a coupon code and <cfhttp> sends all the coupon variables to a third party who operates our web store. Currently, the <cfmail> works perfectly; however, the <cfhttp> does not do its job.

The code is below. Anyone see what I'm doing wrong?

<CFPARAM name= form.name default="">
<CFPARAM name= form.email default="no email addy <webmaster@company.com>">

<cfset randomNumber=RandRange(10000, 99999)>
<cfset coupon="VIDEOMAKER">
<cfset resale="10">
<cfset resaleType="percent">
<cfset numDays="3">
<cfset qtyLimit="10">
<cfset description="10% Off for Videomaker Readers">
<cfset username="gtech">
<cfset password="cdsa3455">

<cfset couponName="#randomNumber##coupon##resale#OFF">

<cfmail to="#form.name# <#Form.email#>" bcc="webmaster@company.com"
from="Coupon Server <coupons@company.com>"
subject="Videomaker Discount Coupon for #form.Name#"
username="support@company.com"
password="6787">

<cfif form.name is not "">#form.Name#,</cfif>

Your personal coupon code to receive #resale#% off all Products is below.

CODE: #randomNumber##coupon##resale#OFF

Just enter this code in the shopping cart and save #resale#% instantly!

Your coupon will expire in #numdays# days.
-------------------------------------------------------
Have a Great Day!
The coupon Server

</cfmail>


<cfhttp
method="Post"
url="https://company.nowdirect.com/exec/gbackcoupon.tsb">

<cfhttpparam

name="discount"
type="url"
value="?couponName=#couponName#&coupon=#coupon#&re sale=#resale#&resaleType=#resaleType#&numDays=#num Days#&qtyLimit=#qtyLimit#&description=#description #&username=#username#&password=#password#"
>

</cfhttp>
ericson3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-02-2009, 06:03 PM Re: trying to send form information via <cfhttp>
ericson3000's Avatar
Experienced Talker

Posts: 40
Name: Bob Davis
Location: Los Angeles, CA
Trades: 0
I was given some advice to rewrite the code as following:

<cfhttp
method="Get"
url="https://company.nowdirect.com/exec/coupon.tsb">

<cfhttpparam name="couponName" value="#couponName#" type="url" />
<cfhttpparam name="coupon" value="#coupon#" type="url" />
<cfhttpparam name="resale" value="#resale#" type="url" />
<cfhttpparam name="resaleType" value="#resaleType#" type="url" />
<cfhttpparam name="numDays" value="#numDays#" type="url" />
<cfhttpparam name="qtyLimit" value="#qtyLimit#" type="url" />
<cfhttpparam name="description" value="#description#" type="url" />
<cfhttpparam name="username" value="#username#" type="url" />
<cfhttpparam name="password" value="#password#" type="url" />

</cfhttp>
ericson3000 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to trying to send form information via <cfhttp>
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32170 seconds with 12 queries