Safely Letting Specific HTML Tags Through Sanitization in PHP

How To | April 20th, 2010

Sometimes you want to let your users express themselves and style their input—whether it be comments, stories, or whatever else—with a few HTML tags. The trick is doing this without letting through all sorts of bad mojo. Now there are many ways to do this, some more complicated than others. I’ve devised a fool-proof accomplish this. While this can work with any tag, (i.e. making [b] into <b>), in this example I’ll be selectively letting through actual HTML tags, rather than aliases. I like to think that by letting users use real HTML tags I might one day help a computer semi-literate learn the fundamentals of HTML. Who knows?
(more…)

Definitive HTML Entities Reference List

Reference List | February 6th, 2010

W3Schools has a great reference for HTML entities… my only complaint is their organization. It is spread over multiple pages making it difficult to find what you already know you want. Without further ado, here is the full HTML Entities Reference List, including both the ASCII character-set as well as the rest of ISO-8859-1.
(more…)