Hi all,
I'm having a problem with CFHTTP. It returns a string ok, but when I get
an HTML file that has links in an imagemap, the 'resolveURL="yes"' attribute
doesn't resolve to a full URL. Is this a bug in cfhttp, or am I doing
something wrong?
For your understanding, I've included the snippet of code (it works! :) that
does the file fetching. It shows the returned file contents, and then
proceeds
to look for fully-qualified URLs, and prints them. But it doesn't find the
ones in an imagemap on
the default.asp page because they are not fully resolved.
Thanks!
Phill Gibson
----------------------
Velawebs Web Designs
www.Velawebs.com
[EMAIL PROTECTED]
----------------------
<cfhttp url= "http://www.velawebs.com/"
method="get"
resolveURL="yes">
<cfset htmlString = #CFHTTP.FileContent#>
<!--- print out the entire content --->
<cfoutput>#HTMLEditFormat(htmlString)#<br><hr></cfoutput>
<!--- Parse HTML file for links --->
<cfset URLArray = ArrayNew(1)>
<cfset URLLoop = 1>
<cfloop index="word" list=#htmlString# delimiters=" ">
<cfif (word contains "http://")
and (word does not contain ".gif")
and (word does not contain ".jpg")>
<cfset word = #HTMLEditFormat(word)#>
<cfset URLArray[URLLoop] = #word#>
<!--- Find first quote around URL --->
<cfset firstQuote = #FindNoCase(""", word)#>
<!--- Find second quote around URL --->
<cfset secondQuote = #FindNoCase(""", word, firstQuote+1)#>
<!--- Strip out URL --->
<cfset URLLength = secondQuote - firstQuote>
<cfset word = #Mid(word, firstQuote+6, URLLength-6)#>
<cfset URLLoop = URLLoop + 1>
<!--- Print URL found --->
URL = <cfoutput>#word#</cfoutput><br>
</cfif>
</cfloop>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.