I'm trying to use PHP_SELF in a class but it isn't working. I have two files:
In classtest.php I create a new web page using the Page class which is defined in page.inc. In page.inc I have a function SetFilename() that gets the basename of the file (I found this function here on ee). Previously, I was using this function directly in a php script file that created a web page (without the use of a class) and it worked. It isn't working using a class.
The value I'm trying to get for the $this->filename variable is: classtest
I anticipated a problem with this but thought that I just might get the wrong value for $this->filename(page from page.inc). But I'm not getting anything.
$classtestpage = new Page();
$classtestpage -> Display();
//class Page's attributes
var $title = 'Test Title';
var $keywords = 'Test Keyword, Test Keyword 2';
//class Page's operations
$brk_filename = explode(".", basename($PHP_SELF));
$num_part = count($brk_filename);
if( $num_part >1)
$this->filename = implode(".", $brk_filename);
echo "this is a test from the display function";
echo "<META name =\"keywords\" content=\"".$this->keywords."\">";