Original Post
Hey sorry for all the code that's going to be below but I just am frusterated beyond belief. This should be working. I have a file called template.php
<?php
require_once( "./includes.php" );
require_once( "./extras.php" );
class gl_template
{
var $temp_dir;
function gl_template($temp_file)
{
echo "ROOT: $fsRoot";
if($temp_file == "" || $temp_file == NULL)
{
$temp_file = "$fsRoot/templates/default/";
}
/*$handle = fopen( "$temp_file/temp.cfg", "r" );
if(!$handle) { return(TEMPERROR_NOEXIST); }
if(!$contents = fread( $handle, filesize("$temp_file/temp.cfg") ))
{ return(TEMPERROR_READ); }*/
require_once( "$temp_file/temp.cfg" );
$dbc = mysql_connect( "$gl_host", "$gl_user", "$gl_pass" );
$p = mysql_query( "SELECT temp_dir FROM configt" );
$result = mysql_fetch_assoc($p);
$this->temp_dir = $result["temp_dir"];
echo $result["temp_dir"];
mysql_close($dbc);
}
function parse_file($temp_file)
{
if(!$handle = fopen( $this->temp_dir . "/$temp_file", "r" ))
{ return(TEMPERROR_NOEXIST); }
$contents = fread( $handle, filesize( $this->temp_dir . "/$temp_file" ));
}
function testF()
{
echo "TEST";
}
}
?>
and then the magical file called extras.php
<?php
$fsRoot = "http://localhost/drsuite/fsv2.0";
?>
I just want template.php to see $fsRoot in the extras.php which I have never had a problem doing before. So when I have test.php and create the gl_template class ($gl_tmp = new gl_template("");) it'll know what the current directory is. For some reason it's not working.