Scared of the Peacock Revolution since 2006
Blog » URL Shortener
I've finally gotten around to making my URL shortener database driven, rather than mod_rewrite and mod_php driven. Next thing I need to do is add some stat whoring, but that can wait.
It's such a basic implementation, that I used cat and echo to open source the code and one SHOW CREATE TABLE query for the schema. Complete source code, including the database schema, is available here.
It requires PHP 5.3, though you could probably rework it so it doesn't use gotos (yes, I used gotos. I have yet to be attacked because of them), then it just requires MySQLi, though that's easy enough to backport to MySQL. So it'll work in whatever version of PHP you want with minimal effort. (Yes, I could do it myself, but screw that.)
Released under the WTFPL, though feel free to give me things if you like it. Or if you don't like it. Just give me things.
The days of visitation are come, the days of recompense are come; Israel shall know it: the prophet is a fool, the spiritual man is mad, for the multitude of thine iniquity, and the great hatred.