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.
Bypass Login to View Content
Every so often I will need to Google a question that will most likely appear inside of forums instead of blog posts. Because of this, I found a really simple way to bypass the “You are Required to Login to View This Post”. If you have never seen this type of page, you’re so lucky.
Bypass Forum (and other) Logins to View Content
The way this works is really simple. A lot of forum software adds a useragent check to detect spiders and bots (such as Google). Since they want Google to see the content on their site to rank better in the search results, Google is allowed to see the content without logging in. This is why when you search for a topic you will see relevant results but may be blocked out of those pages.
Reset Windows Screenshot Index
If you are unaware, inside of Windows 8 (and possibly older versions) you can use the shortcut key combination of [Windows Key] + [PRNT Screen] to take a screenshot and have it saved inside of your Pictures folder. This is great compared to just using the PRNT Screen key alone since you do not have to paste the image inside a photo editing program and then save it.
But this post is about resetting the index of the pictures saved. I take a lot of screenshots and I can have this index get into the hundreds and there only be a few pictures in the folder (since I delete the old ones). Deleting the old pictures will not reset the index, you need to modify a value in the Registry.
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. You have to modify your web servers virtualhosts or host mapping, you also need to modify your DNS (sometimes).
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. If you are wondering why this would ever be
useful, when time is a really important factor, hashing using the
proper algorithm is useful. Hashing is used for more than just
passwords. Hashing is often used as “checksums” to verify files and
their original source, checking for duplicate files when stored in a
database, and more.