« PHP upgrade How to make facebook better »

URL Shortener

Posted by Simon Welsh | 17 July 2010 | Comments (0)

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.


Share on FaceBook

Trackbacks

None
Trackback URL: http://simon.geek.nz/Trackbacks/add/1248

Post your comment

Sign in with Twitter

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments