That sure is some ugly JS and (insecure) PHP scripting. But hey, what do you expect from a website called 'css-tricks'.
Another blog post that furthers bad security practices by actually showing you how write SQL-injection prone code. You don't even need to write it, just cut and paste the security hole right into your project!