tpratt
06-10-2005, 03:09 PM
I am writing a forum script and have users writing to the database using a form. I have set up a system similar to BBCode found on many forums. When the user wants to write a link in their forum post, they input: This is my link! <URL>http://www.codingforums.com</URL> Visit it!
I need to be able to write to the database the content between the URL tags and make it a link. For example. I want: <URL>http://www.codingforums.com</URL> To become:
<a href="http://www.codingforums.com">http://www.codingforums.com</a>
Is there a way to remove the tags in the user's link? I would know how to convert the resulting string into the correct HTML for a link, but I don't know how to initially remove the <URL> and </URL> tags, still storing the content between the tags in a seperate string.
I need to be able to write to the database the content between the URL tags and make it a link. For example. I want: <URL>http://www.codingforums.com</URL> To become:
<a href="http://www.codingforums.com">http://www.codingforums.com</a>
Is there a way to remove the tags in the user's link? I would know how to convert the resulting string into the correct HTML for a link, but I don't know how to initially remove the <URL> and </URL> tags, still storing the content between the tags in a seperate string.