In addition to checking for security screwups that I may have overlooked, I'd be interested in any general commentary or suggestions. I'm pretty much self-taught on PHP so if I've developed any bad habits I'll never know until someone else looks at it...

(I should also clarify that my "If *I* were Emperor of $whatever" schtick is just shorthand for "if there were no practical impediments and I could just declare something done and it would be done that way with no further effort on my part", not a reflection of an assumption that there IS an Emperor of $whatever...)