HTML Purifier

HTML Purifier is a standards-compliant HTML filter library written in PHP. HTML Purifier will not only remove all malicious code (better known as XSS) with a thoroughly audited, secure yet permissive whitelist, it will also make sure your documents are standards compliant, something only achievable with a comprehensive knowledge of W3C’s specifications.

Apache: create a password protected directory

It’s is useful to protect a directory with a password and to allow a directory index. In order to this you need to create a .htaccess file in the directory you created, with these┬álines: AuthType Basic AuthName "Restricted Files" AuthBasicProvider file AuthUserFile /usr/local/apache2/bin/.htpassword Require valid-user Options +Indexes IndexOptions FancyIndexingAuthType Basic AuthName "Restricted Files" AuthBasicProvider file
Continue reading Apache: create a password protected directory

PHP: get the request method

This snippet can be used to get the request method: switch ($_SERVER[’REQUEST_METHOD’]) { case ‘GET’: $params = empty($_GET) ? null : $_GET; break; case ‘POST’: $params = empty($_POST) ? null : $_POST; break; }switch ($_SERVER[‘REQUEST_METHOD’]) { case ‘GET’: $params = empty($_GET) ? null : $_GET; break; case ‘POST’: $params = empty($_POST) ? null : $_POST;
Continue reading PHP: get the request method