Forcing file downloads in PHP
I've seen a number of methods to force file downloads using the PHP header() function which, essentially, sends a raw HTTP header to the browser. Depending on your browser, some files won't be downloaded automatically. Instead, they will be handled by the browser itself or a corresponding plug-in. This is often an issue with PDF files, TXT files, CSV files, LOG files, multimedia files (MP3, WAV, MOV, MPEG, AVI, etc.), and, for many users, Microsoft Office files. As a developer, being able to force the download of any type of file is extremely useful.
Web standards are just "minor details"
A friend of mine recently graduated and spread his wings by venturing into the corporate world. He obtained a position as a junior project manager for a web consulting firm in Atlanta. Their work is very professional and their designs are great, but it was immediately evident that they had no understanding of web standards whatsoever. I asked my friend about his company's stance on the matter.
Creating stylesheets for handheld devices
It's not uncommon so see someone surfing the net with their cell phone or PDA these days or, at least, trying to. Unfortunately, portable technologies still have a long way to go before they conquer the web with their tiny screens. The good news is that, with a little help from stylesheets, your website can look presentable even in the palm of somebody's hand!
Creating a printable website using print stylesheets
I frequently see little printer icons all over the web that clearly mean I can print out a clean version of the webpage that I'm looking at. These little icons are indeed a beautiful sight from the user's perspective. No more having to modify printer settings or copy and paste certain content areas into a word processing program just to get it on paper. In fact, I used to be quite the fan of printable versions on the web until I realized what a pain it can be to develop them.
CSS drop caps
Traditionally found in printed media, drop caps are created by emphasizing the size, color, weight, or style of the first letter in the first sentence of a paragraph. We can easily reproduce this effect on webpages by using the :first-letter pseudo element.
Find and replace hyperlinks and email addresses in PHP
These two PHP functions use regular expressions to add the appropriate HTML anchor tags around hyperlinks and email addresses in $string.
What are favicons?
A favicon (pronounced "fave-icon") is a small, iconic image that represents your website. Favicons are most often found in the address bar of your web browser, but they can also be used in lists of bookmarks in web browsers and feed aggregators.
Using JavaScript to prevent comment spam
Comment spam (also known as 'link spam', 'blog spam', and 'wikispam') occurs when people or spam bots post comments on someones blog, guestbook, or wiki for the sole purpose of boosting traffic and promoting better search engine rankings for their site. Like email spam, it can be particularly annoying and troublesome to deal with.
Password protection using .htaccess and .htpasswd
The simplest way I know to password protect files and directories using Apache's .htaccess and .htpasswd files.
GIF, JPEG or PNG? Using images on the web
This article aims to describe the difference between the three most popular types of images used on the Web, and how to use them effectively in your websites.