html tag filter
I come from a PHP background and am just starting to code ASP pages. My current problem is this:
I have a textarea form in which users can enter info about themselves, in this case a short cv or resume. This info is simply held in a varchar field in a table. Some of the more crafty users have been entering html code in the form to play with their fonts, creating tables etc which are stored in the database. What is the best way to filter html code out of the inputted user form data?
Many thanks in advance...
Replace < and > with their ascii equivelants.
strContent refers to a variable that holds the value of the textarea. This should actually just print the HTML to the page.
strContent = Replace(strContent, "<", "<")
strContent = Replace(strContent, ">", ">")
There is also a handy funtion available at 4guysfromrolla.com that will solve your problem. See it here: http://www.4guysfromrolla.com/webtech/073000-1.shtml
That link is exactly what I was after, thanks!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)