PHP Development
Redefining or changing a PHP $_SERVER variable for an entire website.
Today, I was faced with the need to redefine a PHP $_SERVER variable for an entire application, made up of hundreds of PHP pages. In this case, I needed to redefine $_SERVER['DOCUMENT_ROOT'] for an entire website. The application was built by another company under the assumption that $_SERVER['DOCUMENT_ROOT'] would always point to the document root, [...]
Remove Unnecessary Querystring From .htaccess 301 Permanent Redirects
Today I ran into an odd problem while trying to create permanent redirects on a website to help with search engine optimization. The website I was working on used a fairly standard URL rewrite rule that rewrite all portions of the URL to a querystring and then the application handled the querystring internally. This methodology [...]
How to Detect a User’s Language with PHP
I was recently looking for a simple way to automatically detect a user’s language using PHP. There are a number of ways this could be accomplished but after some thought I realized the easiest is to get that information from the users web browser. Users are most likely to browse the web in a language [...]
Start MySQL Auto-Increment at a Number Other Than 1
By default, MySQL will start auto incrementing from 1 with each new entry. This means the first entry in a database is 1, the second is 2, and so on. Occasionally, it may be helpful to start this number at another value. It could be for sequential product numbers, better disguised customer ID numbers, or [...]
Christmas 2009
This year we had 3 Christmas events. The first was with my side of the family the week prior to Christmas and the last two were with Kayla’s family on Christmas Eve and Christmas day. Since I have been too busy lately with work and family to sit down and write I thought I would [...]
How to Read a Remote Text File with PHP
Reading text files with PHP isn’t really too difficult. I have done it quite a few times but it isn’t something I do everyday. A few weeks ago, I wrote a simple script to read a text file and it has been working great, until today. Originally, the script I wrote was reading a very [...]
Software to Automatically Make a HTML version of a Dynamic Website
It seems like there are a million different content management systems out there. Some like the ZLCMS system we use at Zipline are transferrable to another web host but occasionally we have run into web development companies with ‘proprietary’ content management systems. Many of these companies won’t allow their customers to transfer their website to [...]
How to use PHP in .htm or .html Files
The need to execute PHP in HTM or HTML files may occur for a number of reasons. The most common of which seems to be adding content managed portions to an existing HTML website. The .htm or .html pages will be part of the navigation, previously indexed by search engines, and likely linked to by [...]
How to Detect IE6 Browser with JavaScript
I have been doing a lot of work with jQuery lately. The jQuery library offers great cross browser support for most functions but unfortunately even this magic wand can’t solve all the problems with Internet Explorer 6 (IE6) compatibility. Previously, jQuery had a browser() function that helped detect a browser so that a developer could [...]
Block .inc Files from Displaying on an Apache Web Server
Block .inc Files from Displaying on Apache Web ServerBlock .inc Files from Displaying on Apache Web ServerMany PHP developers use the .inc file extension to signify a script that is included within another. This can be very handy when scanning a directory or block of code looking for specific references or calls. One of the [...]

