PHP: Offline Downloads

It is not uncommon to want your site users to be able to download files, but only the specific ones you want them to. To make this possible, you need to store the files somewhere offline, where there isn't a direct URL to them, and you have to be able to insert security. There are, I've found, about a jillion ways to skin this cat, but this one worked for me.


PHP: Error Logging

Here's a little bit of code I put together to handle error logging in PHP.

First, I set a couple variables for global use. I put these at the top of a common include file, or some other page that will be included anywhere the function might be called:


PHP: Temporary Random Password Generator

Sometimes, you need to generate a temporary password for a new user. Something that meets your security requirements, and is painful enough to make the user change it as soon as they log on. I've got just the ticket.



Subscribe to RSS - PHP