Click to See Complete Forum and Search --> : HTML Tags


wowrang
08-21-2006, 04:15 PM
Hi ,
I have a asp page where i am getting input text from textarea, there user is allowed to enter text like this strong text [ URL]www. webdeveloper.com[/URL]. Then i am stronging this to database.

if display this values in a page that needs to be like this strong text needs to be strong(bold) and url is linke www.webdeveloper.com.

Pls help me to do this.
Thanks.

ray326
08-21-2006, 05:04 PM
Display it in a div rather than a textarea.

virtuald
08-22-2006, 12:29 AM
If you use a textarea -- beware of possible malformed HTML stuff (for example, the user inputs a </textarea> in their input), which makes it so they can do whatever they want to your page. Lots of possible exploits.

Also, when they type certain HTML special entities in there (like &nbsp; ), then some browsers tend to display the entity itself (a space) instead of the code for it (&nbsp; ), so your best shot is to use a lil bit of javascript and encode the data before actually putting it in the textarea. :)