Articles

A written collection of knowledge on a particular topic, not covering the bredth or depth of a topic. Just particular aspects therein.

Sanitation Class for PHP

Sanitation Everyone loves to loves a clean environment... but no one loves to clean.  I am no exception. But I understand the need.  After working on PHP for years, and discovering no really good libraries out there for data sanitation... I have written my own.  (I tried to use OWASP's ESAPI... but gave up...) Definition: According to google Sanitation is "Conditions relating to public health, esp. the provision of clean drinking water and adequate sewage disposal"...

Read More

Validation Class for PHP

Validation Class for PHP Remix As a Web developer, I have seen my share of crappy and insecure code out there.  (Especially working on other people's code.)  One of the biggest problems and security breaches I see is the failure to properly validate data before using it.  Earlier this year I started to build a validation library and posted it up on this site.  In my programing "evolution" I have learned a few techniques that (in my opinion) are superior to the...

Read More

Random String Generator

Random String Generator in PHP Every programmer at some point needs to generate random strings.  Either for testing, salts, garbage data, or even ipsum.  Well I wrote a script back in 2008, and it has been buried in a pile of hard disks until just recently.  So here is my PHP Random String Generator: /** * random_string_generator($length, $char_list) * * This function generates a random string that is the size of $length, * composed of the characters in $char_list. * @param ...

Read More