Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFHTTP POST Not Working, But Form POST Does

Status
Not open for further replies.

Glowball

Programmer
Oct 6, 2001
373
US
Hey all, I'm trying to CFHTTP POST form info to another server, both machines inside our firewall. I'm just testing, so it's a simple form using POST sending "firstname" and "lastname" fields. The second script just repeats everything POSTed to it. I did two forms on the same page for testing:

One form submits to itself and uses CFHTTP POST and two CFHTTPPARAM tags to send the two bits of info as FORMFIELD types. This one returns nothing in CFHTTP.FileContent with no errors.

The other form submits directly to the other page. That time it spits back the form values.

Question: how can one work and the other one doesn't? Isn't it basically the same action?

Any help appreciated, thanks!
 
Not quite... CFHTTP post is for posting internally without changing pages.. without appearing in the source code..

Try this... on the page you cfhttp post to..

<CFIF form.fieldnames is &quot;&quot;>
<CFFILE action=&quot;write&quot; file=&quot;#expandpath(&quot;billofwrites.txt&quot;)#&quot; output=&quot;It didn't work.&quot;>
<CFELSE>
<CFFILE action=&quot;write&quot; file=&quot;#expandpath(&quot;billofwrites.txt&quot;)#&quot; output=&quot;f: #firstname# l: #lastname#&quot;>
</CFIF> ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Right -- CFHTTP is definitely what I want because I want to POST to another page and get the return data back without leaving my initial page. I used the FORM as a method of testing only.

Here's an update, I think it may be an internal DNS issue but I'm not a network person so I'm not sure. In the example below, the &quot;Internal Server&quot; is inside the firewall and the &quot;External Server&quot; is outside the firewall.

Internal Server => Internal Server == does not work
Internal Server => External Server == works
External Server => External Server == works

Does this sound like DNS?
 
Are you using localhost...? I actually had the same problem a while back... one of those devilspawn gadgets that replaces your 404 domain page... I think rather than saying:

localhost\blah\blah_de_blah

I said:

127.0.0.1\blah\blah_de_blah ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
I'm going from one internal machine (subdomain.mydomain.com) to another one (machinename:port) -- is that it?

I can POST directly to machinename:port from a form and it works, though the user then stops at that page so CFHTTP is what I really need.

TIA!
 
oh.. ping it and get the ip address...

I hate the devilspawn gadgets.. ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Thanks! I just figured out what it is... the server I thought was internal actually is not. Who knew? This makes it interesting...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top