I found something else:

What if you set URL = to the Website you want and then place the following
if statement:

<CFIF NOT #Mid(word, firstQuote+6, URLLength-6)# contains "http://">
        <CFSET word = "#URL##Mid(word, firstQuote+6, URLLength-6)#">
<cfelse>
        <cfset word = #Mid(word, firstQuote+6, URLLength-6)#>
</cfif>

This adds your URL to the list if it does not contain an http:// reference

-----Original Message-----
From: Phill Gibson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 23, 2000 3:01 PM
To: CF-Talk (E-mail)
Cc: [EMAIL PROTECTED]
Subject: CFHTTP, resolve="yes", and Imagemap URLs


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("&quot;", word)#>

                <!--- Find second quote around URL --->
                <cfset secondQuote = #FindNoCase("&quot;", 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.


------------------------------------------------------------------------------
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.

Reply via email to