Could be lots of things but it probably stems from initializing members variables in the wrong spot. Try using a constructor:
class Test {
var $pagePath;
var $page;
var $counter;
// Use constructor to initialize member
// variables
function Test() {
$this->pagePath = dirname($REQUEST_URI);
$this->page = basename($REQUEST_URI);
$this->counter = explode("/", $this->pagePath);
}
}
I have made it a habit not to use global variables from within my classes (it is not great object-oriented practice) so you may want to initialize by passing in the global values:
class Test {
var $pagePath;
var $page;
var $counter;
// Use constructor to initialize member
// variables
function Test($reqURI) {
$this->pagePath = dirname($reqURI);
$this->page = basename($reqURI);
$this->counter = explode("/", $this->pagePath);
}
}
You would then create your object like this:
$objTest = new Test($REQUEST_URI);
G'luck,
Jack