Filesharing written in PHP, spaghetti edition