Blog / Programming

rss

Quickie: IE and window.close()

IE tends to do some funny things with its security settings. In particular, if your settings are high enough, window.close() will throw a warning or silently stop working entirely. This is definitely not our preferred behavior, and luckily, there’s an easy hack provided by FatTonny on the SitePoint Forums. window.opener = window; window.close(); That’s all [...]

Read Post

XHTML: The Myth and You

A couple of years back, XHTML became the big new buzzword for webdevelopers and everyone (myself included) jumped on the bandwagon, converting all of their pages from HTML 4.01. However, what we didn’t realize at the time was that we were being lied to. And as a result, most everyone is still using it incorrectly. [...]

Read Post

PHP Templates done easy.

Lots of people swear by Smarty or any one of a number of template engines out there. However, I’m a bit stubborn, and like to reinvent the wheel. After all, PHP really is a template engine in and of itself. So I’ve been fighting with writing a template wrapper, and I had a pretty decent [...]

Read Post

MySQL / PHP / Internationalization

Oh, man. This was a toughie. What follows is an account of how to deal intelligently with foreign characters and data entry in PHP/MySQL. So I’m working on a site, and realize that I need to handle foreign names within content. No fun. So I change my MySQL table to use utf8_general_ci, instead of ye [...]

Read Post

MySQL Quickie: the HAVING clause – process duplicate lines.

This one has been driving me crazy for years. Let’s say that you have a MySQL database with a bunch of users in it, and you want to see only those users that have duplicate email addresses. You’d think this would work, but it doesn’t: SELECT COUNT(*) AS count, * FROM users WHERE count > [...]

Read Post