Sorry maybe i am not explaining what i am trying to do in the right way, so i will try to explain it better.
I do not believe that i have to worry about any codes other than the ones i have listed below.
HTML Code:
<b><i><a><hr><img><center><font><table><tr><td><p><div><object><param><embed><bgsound>
Because i have used the strip_tags function to strip out all codes other than the ones i have allowed.
PHP Code:
<?php
// below is the variable that all the profile information is stored in...
$editprofile;
// below is the strip_tags function stripping out all codes eccept for the ones i have listed...
$editprofile = strip_tags($editprofile, "<b><i><a><hr><img><center><font><table><tr><td><p><div><object><param><embed><bgsound>");
?>
So the above code should strip out all the bad tags that i do not want people to use.
-------------------------------------------
What i am trying to figure out is how do i stop people from putting bad tags like below into their profile.
HTML Code:
<IMG SRC="javascript:alert('XSS');">
<BGSOUND SRC="javascript:alert('XSS');">
<BR SIZE="&{alert('XSS')}">
<TABLE><TD BACKGROUND="javascript:alert('XSS')">
<DIV STYLE="background-image: url(javascript:alert('XSS'))">
Now with the above codes that i do allow in profiles that has the word javascript i can replace the word javascript with the ascii characters for the word javascript, and what do i do about tags like below that i allow that does not have the word javascript in them?
HTML Code:
<IMG SRC="jav	ascript:alert('XSS');">
<IMG STYLE="xss:expr/*XSS*/ession(alert('XSS'))">
<OBJECT TYPE="text/x-scriptlet" DATA="http://ha.ckers.org/scriptlet.html"></OBJECT>
<EMBED SRC="http://ha.ckers.org/xss.swf" AllowScriptAccess="always"></EMBED>
Now lets say that one person gives a valid img code and another person gives a img code with xss in it, if i was to replace "<" with </; all codes would be seen on their profile no matter if they were valid or not.
What i am trying to figure out is how do i filter out bad xss from between good tags that i allow people to use? i am having a hard time understanding this because i have never seen half of the characters in these xss attacks.
Sorry if i am being bothersome but this is the most help that i have gotten on this problem and i really need to understand how this works. Thanks!