Solved

How do you parse cfhttp.filecontent for a specific word?

Posted on 2009-07-16
2
309 Views
Last Modified: 2013-12-24
I am posting and get a web page back as a reponse and nee to parse for the word accepted.

<cfhttp post ....>

<cfoutput>#cfhttp.FileContent#</cfoutput>
     <cfset postresponse = "#cfhttp.FileContent#">
The response I get back is a full html page with lots of  data.
0
Comment
Question by:LeadCo
2 Comments
 
LVL 36

Accepted Solution

by:
SidFishes earned 500 total points
ID: 24873732
depends on what you are trying to do...

if you just want to know if accepted exists in the page it's easy

<cfif findnocase(" accepted ", cfhttp.filecontent)>
Found
<cfelse>
Not Found
</cfif>

note this looks for the whole word accepted with a space on each side of it...you may need to modify

if you need to extract specific instances ie: a confirmation number it's more complicated


i use cf_reextract  http://www.cftagstore.com/tags/cfreextract.cfm

it's $15 but i use it for a ton of stuff (payment validation, automated form data submission  etc)
0
 

Author Closing Comment

by:LeadCo
ID: 31604348
Thanks!
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question