Would this solution work if there is more than one web address in the memo
field?

<-C

_________________________

Date: Fri, 26 May 2000 12:52:58 -0600
From: "Shane Pitts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: RE: Parsing text in memo field to recognize web addresses
Message-ID: <[EMAIL PROTECTED]>

This one will do it, if it is like a paragraph, and the URL is in the middle
of it.

<CFOUTPUT query="yourquery">
<CFIF #FindNoCase('http://', "#string#", 1)#>
        <CFSET thestart = #FindNoCase("http://", "#string#", 1)#>
        <CFSET theend = #FindNoCase(" ", "#string#", #thestart#)#>
        <CFSET urllength = #theend# - #thestart#>
        <CFSET theurl = #mid("#string#", #thestart#, #urllength#)#>
        <CFSET thelength = #len(string)#>
        <CFSET remainder = #thelength# - #theend#>

        #left(string, "#thestart#" - 1)# <A href="#theurl#">#theurl#</A>
#mid(string, "#theend#", "#remainder#")#

<CFELSE>

        #string#

</CFIF>
</CFOUTPUT>



-----Original Message-----
From: Curt Makepeace [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 26, 2000 11:57 AM
To: '[EMAIL PROTECTED]'
Subject: Parsing text in memo field to recognize web addresses


Is there some way to get your coldfusion app to recognize a web address?

i.e., this is what I would like to do in the app:
The text goes into a memo field in the access database normally. When the
message is displayed through the app, and if it finds the text 'http:\\'
anywhere in the field, it will add the 'a href' syntax to that string to
make the link 'clickable' within the text.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
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