These tutorials need a massive red flashing warning saying "we've left critical stuff out, you will get your site defaced if you code like this".
Newbies don't need to be expected to know good code. That's no excuse for presenting actively dangerous examples to them with no warning.