[thelist] Help with a replace loop
Shinji Kuwayama
shinji at kuwayama.com
Mon Jun 11 13:56:38 CDT 2001
Hi - I want to replace keywords in a string with a linked version of same,
like this:
<cfquery name="GetKeywords" datasource="theDatasource">
select keyword, link
from KeywordsTable
</cfquery>
<cfloop query="GetKeywords">
<cfset string = Replace(string,"#keyword#",'<a
href="#link#">#keyword#</a>', "ALL")>
</cfloop>
It works okay, but my problem is this: when it loops back around, it will
find the keyword inside the titletext string and replace it, which wrecks
things.
Can anyone point me in the right direction?
--
Shinji Kuwayama
Director, Internet Development
http://www.internetcoach.com/
More information about the thelist
mailing list