Check for unsafe HTML
5 answers - 202 bytes -

Hi all,
I need to check html that is entered by user for unsafe content (ie
javascript, vbscript, onmouseover etc) and still keep "safe" tags. Is
there any easy way for that?
Boban.
No.1 | | 401 bytes |
| 
At 4:12 PM +0200 8/30/06, Bogdan Ribic wrote:
>Hi all,
>
I need to check html that is entered by user for unsafe content
>(ie javascript, vbscript, onmouseover etc) and still keep "safe"
>tags. Is there any easy way for that?
>
>Boban.
Try strip_tags().
http://us3.php.net/strip_tags
tedd
No.2 | | 553 bytes |
| 
Bogdan Ribic wrote:
Hi all,
I need to check html that is entered by user for unsafe content (ie
javascript, vbscript, onmouseover etc) and still keep "safe" tags. Is
there any easy way for that?
PRTFM: http://php.net/striptags
Boban.
we have a 'Matt' that's actually a 'Dave' (or is it the other way around),
now we have a 'Bogdan' who is propably a 'Boban'.
Im sure there are other examples.
Seems we attract multiple personality disorder cases around here.
No.3 | | 504 bytes |
| 
tedd wrote:
At 4:12 PM +0200 8/30/06, Bogdan Ribic wrote:
>Hi all,
>>
>I need to check html that is entered by user for unsafe content (ie
>javascript, vbscript, onmouseover etc) and still keep "safe" tags. Is
>there any easy way for that?
>>
>Boban.
Try strip_tags().
<yodism>do, not try.</yodism>
http://us3.php.net/strip_tags
tedd
No.4 | | 369 bytes |
| 
<yodism>do, not try.</yodism>
>http://us3.php.net/strip_tags
>>
>tedd
Thanx, you've been lots of help :) But I wanted to clean out unwanted
tags, not all of them. I found this class:
that is supposed to do the job, in case someone else has same problem.
No.5 | | 625 bytes |
| 
we have a 'Matt' that's actually a 'Dave' (or is it the other way around),
now we have a 'Bogdan' who is propably a 'Boban'.
Im sure there are other examples.
Seems we attract multiple personality disorder cases around here.
Good catch :)
Boban is my nickname that everybody calls me, Bogdan is written in all
documents.
as for RTFM, I was looking for a way to strip javascript tags etc while
leaving everything else in place. I knew about strip_tags. I found a
class later that does the job (look at my other posting in this thread)