Published in Web Development on Thursday, October 7th, 2004
Tie together some cloaking and the user-agent string widget for Firefox and you've got a handy tool.
Here's a little trick that we've been using lately for certain things, cloaking!
Disclaimer: we've used this trick in the situations descibed below and it has worked well. It is not super secure, so use caution when applying!
Tied together with the User Agent Toolbar Widget, we've been using cloaking for things from private site previews to in-situ error testing. How you ask?
We recently finished a redesign for a clients site. What we wanted was a way to lay the new site (new script) over the old one, and have our client, with offices across Europe, be able to seamlessly preview the new site, without the general public sneaking a peek.
In this case what we did was have the server check the user-agent string of the browser for a "top-secret" agreed upon string that the client set in the UA widget. Depending on the value, the script would serve up the appropriate site. We could have done this with specific IP's or a login screen somewhere, but this method was simple, fast, and we managed to get quite a few people to download and install Firefox - they had to to see the site!
error_reporting(E_ALL)in PHP based on the presence of a certain UA string, for example, and again trouble-shoot privately and in place.
Any others ideas??
I started freelancing by diving in head first and getting on with it. Many years and a lot of experience later I was still able to take away some gems from this book, and there are plenty I wish I had thought of beforehand. If you are new to freelancing and have a lot of questions (or maybe don't know what questions to ask!) do yourself a favor and at least check out the sample chapters.
Like the other books listed here, this provides a great reference for the PHP developer looking to have the right answers from the right people at their fingertips. I tend to pull this off the shelf when I need to delve into new territory and usually find a workable solution to keep development moving. This only needs to happen once and you recoup the price of the book in time saved from having to develop the solution or find the right pattern for getting the job done..