Handling Purchased File Downloads

Making it so your website can handle file downloads is very important now-a-days. Either it be when you are giving out your free CD or if you want to distribute your software. The above two are simple, you simply link to a public location where the file is accessible. But what if you want users to buy your software or music? Now it gets a little more interesting. The first obvious solution is to find a service that handles this, such as iTunes or a software distributor.

PHP Prevent Include Direct Access

It’s good practice to limit where your website visitors can go so they don’t get into trouble or cause problems with your site. Although, problems should occur when they directly access a file they are not supposed to, sometimes you can’t help it. Below is a very simple way to prevent your users from directly accessing important system files for your website. What you have to first do is identity a file that all pages use and include.

Setup PHP Development Web Server Quickly inside of Windows

Since PHP 5.4.0, the developers included one of the most amazing features to ever exist. A built in development web server. In the below steps or if you choose to, in the video, you will learn to setup and run your own development web server using only the PHP client. You don’t have to worry about setting up and configuration Nginx, Apache, IIS or various other server software to quickly test your website before publishing it.

PHP Dynamic Subdomains

Giving users a subdomain name is sometimes better when you want users to have their own piece of the website. For example, Tumblr, Blogger, WordPress all will give you a subdomain name. A subdomain is a prefix on the existing URL followed by a period. The most common sub domain you will see is “www”. To give you users a subdomain is a little more difficult than just having the users profile as a directory on your site.

PHP Calculate Time for Hashing Algorithms

Figuring out the time required for each hashing algorithm in PHP is a simple task of running a string through the hash() function and timing it with microtime(). I needed to do this for all of the available algorithms and sort them from fastest to slowest. Please keep in mind that if hashing for the purpose of passwords, don’t go by which hashing function is the fastest, security can take a few extra thousandths of a second.