PDA

View Full Version : How would i strip bad codes between good codes?



yash059
08-18-2009, 02:58 PM
I am making a small website and i am going to allow people to make profiles, in the profiles i want to allow them to use html codes to fix their profiles up like with music players, and images and scroll boxes stuff like that.

And i am having a hard time understanding how to do it, i was going to make 2 arrays one with bad codes and replace them with good codes in the other array with preg_replace() but i am not understanding how do i make it look for bad code that could be written in many way.

Could someone give me an example of how i would do this?

information
09-01-2009, 09:31 AM
Why don't you provide this functionality through your interface rather than allowing them to enter the html code themselves?

Resonate
09-02-2009, 03:40 AM
http://validator.w3.org/

Enter your code in make sure you select revalidate & click go. validated code is at bottom