- Feb 11, 2005
- 4,263
- 0
- 0
Hello.
I'm making an interface for creating and editing data stored in a file. I don't allow the user to use any kind of HTML, so I've created a VB code type of thing, which I have working just as expected. However, I want to have links where any http:// string is made into an HTML link. I've accomplished this bit fine (using attached code from the php.net docs), but when the user edits a story, I need the links to be converted back into just the URL while they're looking at it. I found via google search (also attached), an ereg_replace function that does this, but it truncates the result so it begins with the last replaced link and ends at the end of the file. (a demo is also attached)
EDIT:
Sorry, the code didn't maintain my line breaks!
I have comments indicating each item.
EDIT 2: After editing, it appears the AT parser doesn't like me - I'm posting my attachment on pastebin
EDIT 3: http://pastebin.com/m7e3069c9
I'm making an interface for creating and editing data stored in a file. I don't allow the user to use any kind of HTML, so I've created a VB code type of thing, which I have working just as expected. However, I want to have links where any http:// string is made into an HTML link. I've accomplished this bit fine (using attached code from the php.net docs), but when the user edits a story, I need the links to be converted back into just the URL while they're looking at it. I found via google search (also attached), an ereg_replace function that does this, but it truncates the result so it begins with the last replaced link and ends at the end of the file. (a demo is also attached)
EDIT:
Sorry, the code didn't maintain my line breaks!
I have comments indicating each item.
EDIT 2: After editing, it appears the AT parser doesn't like me - I'm posting my attachment on pastebin
EDIT 3: http://pastebin.com/m7e3069c9