• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfhttp post to new page

New Here ,
Aug 23, 2006 Aug 23, 2006

Copy link to clipboard

Copied

Hi

Im trying to use cfhttp to post some variables to a new page. I then want the new page to be displayed, so i am using redirect="yes", but it is not redirecting, just staying on the posting page. Here is the code i have in the posting page and the redirect page:

post.cfm

<cfhttp url="receive.cfm" method="post" redirect="yes">
<cfhttpparam name="SessionID" value="#SessionID#" type="FormField">
<cfhttpparam name="Amount" value="#Amount#" type="FormField">
</cfhttp>

receive.cfm:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
</head>
<body>
<cfoutput>
#Amount#
</cfoutput>
</body>
</html>

ive read somewhere that you need to return location in a header or something, but i cant find any examples or explanations. Does anyone know how this is done?

Thanks

Rob
TOPICS
Advanced techniques

Views

625

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 24, 2006 Aug 24, 2006

Copy link to clipboard

Copied

Can anybody point me in any kind of direction? im having no luck.

thanks

Rob

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 24, 2006 Aug 24, 2006

Copy link to clipboard

Copied


I made two changes to your code.

Here's the new code with the two changes...

<cfhttp url=" http://localhost/receive.cfm" method="post" redirect="yes">
<cfhttpparam name="SessionID" value="#SessionID#" type="FormField">
<cfhttpparam name="Amount" value="#Amount#" type="FormField">
</cfhttp>

<cfoutput>#cfhttp.fileContent#</cfoutput>

Perhaps there was confusion about how the redirect attribute works?
Or perhaps I miss-understood what you are trying to achieve.

My interpretation of what you wanted was to allow the page doing the posting
to be redirected vs allowing the page receiving the post to be redirected.

I think the redirect attribute allows the page receiving the post to be redirected?


Good luck!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 24, 2006 Aug 24, 2006

Copy link to clipboard

Copied

LATEST
Hi,

Basically what i want to achieve is the same effect as when a normal form is posted.

post.cfm would be the page with the form on, and receive.cfm would be the output page, displaying the variables sent from receive.cfm

I cant simply display the contents of receive.cfm in post.cfm using cfhttp.fileContent, as receive.cfm is going to be on a secure server.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation