How to handle posted HTML and URLS
Posted: Mon May 07, 2007 4:33 pm
Hello,
I've been trying to figure out the best solution for what I need to do. I think it's simple enough, just need direction.
Ultimately, I need to handle posted info just like these forums.
What I need to do is this:
When a user posts to my site, I need:
1. Any HTML code to be visible as code.
2. Urls to be converted to clickable links.
3. Safely allow single and double quotes.
I've been using htmlentities, and htmlspecialchars, but I'm not getting the right result.
Any help would be greatly appreciated. This is already eating up too much time.
Thanks!
I've been trying to figure out the best solution for what I need to do. I think it's simple enough, just need direction.
Ultimately, I need to handle posted info just like these forums.
What I need to do is this:
When a user posts to my site, I need:
1. Any HTML code to be visible as code.
2. Urls to be converted to clickable links.
3. Safely allow single and double quotes.
I've been using htmlentities, and htmlspecialchars, but I'm not getting the right result.
Any help would be greatly appreciated. This is already eating up too much time.
Thanks!