The PHP “heredoc” Syntax

An excellent alternative method to assigning string variables is to use the heredoc syntax. If you are assigning long strings of text with characters that need escaping, try this: To me, it looks a bit messy at first, but it does make large chunks of text more readable in your code. Consider this alternative to…

PHP REGISTER_GLOBALS turned off? Hack It Back

REGISTER_GLOBALS is a PHP directive that, when enabled, automatically initialises variables with the values from forms, sessions, GET etc. For example, the data in a login form with the input fields named “username” and “password” will automatically be available as $username and $password. REGISTER_GLOBALS is, in my opinion, very bad practice and should be avoided…