Tweeter button
Facebook button

Allow Google to Index Password Protected pages

We have a couple of clients that would like Google to index the password protected areas of their websites.

A nice way we have found of doing this is by checking for the user agent when authorising the user.  Something like (in PHP!):

if($userAuth || substr_count($_SERVER['HTTP_USER_AGENT'],’Googlebot’) > 0) {
// Enter site
}

This isn’t a good idea iof the [...]

Dales and Vales Cottage Holidays

The latest website from Skipton Systems is now [...]

Multiple Constructors (Overloading) in PHP

It is a huge frustration to me that PHP does not support constructor overloading in the same way that other OOP (Object Orientated Programming) languages do.  There is a workaround, however:

class MultipleConstructor {

private $info = ”;

function __construct() {
$argv = func_get_args();

switch( func_num_args() ) {
default:
case 1:
self::__construct1($argv[0]);
break;
case 2:
self::__construct2( $argv[0], $argv[1] );
break;
}
}

function __construct1($value) {
$this->info = $value;
}

function __construct2($value, $value2) {
$this->info [...]

WAMPServer

I have been tasked with setting up a Windows 2003 server, which is going to run as a file server as well as a web server for a company intranet.  The intranet currently runs externally on PHP/mySQL.  This is now going to be moved into the office.  Had the company not requested Windows, this would [...]

$_SERVER['DOCUMENT_ROOT']

I run PHP on IIS for the Skipton Systems intranet.  I moved servers today, and everything stopped working.  After an hour of hunting, I traced the problem to the line of code I have at the top of every page to include the database files:

$_SERVER['DOCUMENT_ROOT']

It turns out that IIS doesn’t support this feature.  However, this [...]