Give this a shot....
<!---
File: PostInfo.cfm
Inputs: Query Values from Dealer Datasource
Outputs: CFHTTP Call With Form Fields Corresponding to Oracle DB Cols
--->
<!--- Get Dealer Info From Local DSN --->
<CFQUERY NAME="send" DATASOURCE="#application.DSN#" >
SELECT DEALERNAME, ADDRESS, CITY, STATE, ZIPCODE, TEL, EMAIL, WEBSITE
FROM Dealers
</CFQUERY>
<!--- Use a loop to send to remote system --->
<CFLOOP query="send">
<CFOUTPUT>
<CFTRY>
<cfhttp url="http://reoteserveripaddress/insertdealers.cfm"
method="POST" port="80" resolveurl="false">
<cfhttpparam type="FORMFIELD" name="dealername"
value="#send.dealername#">
<cfhttpparam type="FORMFIELD" name="address" value="#send.address#">
<cfhttpparam type="FORMFIELD" name="city" value="#send.dealername#">
<cfhttpparam type="FORMFIELD" name="state"
value="#send.dealername#">
<cfhttpparam type="FORMFIELD" name="zipcode"
value="#send.dealername#">
<cfhttpparam type="FORMFIELD" name="tel" value="#send.dealername#">
<cfhttpparam type="FORMFIELD" name="email"
value="#send.dealername#">
<cfhttpparam type="FORMFIELD" name="website"
value="#send.dealername#">
</cfhttp>
<CFCATCH type="Any">
Error Occurred While trying to Post Information
Message: #cfcatch.message#<BR><BR>
Details: #cfcatch.details#<BR>
</CFCATCH>
</CFTRY>
</CFOUTPUT>
</CFLOOP>
</CFOUTPUT>
This is the insertdealers.cfm on the remote server:
<!---
File: Insertdealers.cfm
Inputs: Form Values From PostInfo.cfm
Assuming that all data columns are type varchar or nvarchar.
Outputs: None
Make sure that the datatypes are correct (i.e., zipcode is not stored as
an integer). You'll need to check with the DBA that is so uncooperative.
--->
<cfquery name="test" datasource="#application.DSN#" >
INSERT INTO Dealers (DEALERNAME, ADDRESS, CITY, STATE,
ZIPCODE, TEL, EMAIL, WEBSITE)
VALUES('#form.dealername#', '#form.address#', '#form.city#',
'#form.state#', '#form.zipcode#', '#form.tel#'
'#form.email#', '#form.website#')
</cfquery>
Jeff Garza
Web Developer/Webmaster
Spectrum Astro, Inc.
480.892.8200
[EMAIL PROTECTED]
http://www.spectrumastro.com
-----Original Message-----
From: Jeff Fongemie [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 3:49 PM
To: CF-Talk
Subject: trouble with cfhttp and post
Hello everyone,
I'm trying to get the result of a query from my local DSN to a remote
DSN.
I'm trying to use CFHTTP and POST but I'm not getting very far.
This is what I have for my local page:
<CFQUERY NAME="send" DATASOURCE="#application.DSN#" >
SELECT DEALERNAME, ADDRESS, CITY, STATE, ZIPCODE, TEL, EMAIL, WEBSITE
FROM Dealers
</CFQUERY>
<CFOUTPUT query="send" >
There are #send.RecordCount# Dealers
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<cfhttp url="http://reoteserveripaddress/insertdealers.cfm" method="post">
<cfhttpparam name="jeff" value="send" type="FORMFIELD"
TIMEOUT="100">
</cfhttp
</CFOUTPUT>
This is the insertdealers.cfm on the remote server:
<cfoutput>
<cfquery name="test" datasource="#application.DSN#" >
INSERT INTO Dealers
VALUES('#form.myName#')
</cfquery>
#form.jeff#
</cfoutput>
So, when I run the first page on my local drive, it sits for a long
time, lights on the cable modem are flashing looking good, then it
tells me how many records there are. I get excited, and look on the
remote datasourse by running a simple query and NOTHING! Where the
heck is my data going??!!
What is wrong with my code above?
THe remote server is an Oracle database that the admin won't use SQL
loader to input my records, he want's me to get it there myself using
CF.
Any ideas would be most appreciated.
Jeff
Best regards,
Jeff Fongemie mailto:[EMAIL PROTECTED]
------------------------
Internet Guns For Hire
(603) 356-0768
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists