1. Carl Gottlieb Guest

I have an asp page which allows users to submit an article to a site. However I need to be able to convert text hyperlinks to actual ones. How can this be done? I have heard mention of using a search for a http or mailto, it then formats the text into a hyperlink and then stops once it reachesa space / return.<BR><BR>regards<BR>Carl Gottlieb

2. Senior Member
Join Date
Dec 1969
Posts
102

## RE: converting text into hyperlinks

intPos = InStr(intPos,strText,"http://")<BR>do while intPos &#062; 0<BR>strTextLeft = ""<BR>if intPos &#062; 1 then strTextLeft = Left(strText,intPos-1)<BR>intEnd = 0<BR>intEnd1 = InStr(intPos,strText," ")<BR>intEnd2 = InStr(intPos,strText,chr(13)&chr(10))<BR>if intEnd1 &#060; intEnd2 then intEnd = intEnd1 else intEnd = intEnd2<BR>if intEnd = 0 then intEnd = Len(strText)<BR>strTextMid = Mid(strText, intPos, intEnd - intPos)<BR>strTextRight = ""<BR>if intEnd &#062; len(strText) then strTextRight = mid(strText,intEnd)<BR>strText = strTextLeft & "&#060;a href=&#039" & strTextMid & "&#039&#062;" & strTextMid & "&#060;/a&#062;" & strTextRight<BR>intPos = intPos + (Len(strTextMid)*2) + 13<BR>intPos = InStr(intPos,strText,"http://")<BR>loop<BR><BR>That should work, for strings containing &#039http://&#039, not too tricky to mod it for &#039mailto:&#039 too.<BR>strText is the text you want to scan<BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•