hi guys,
how are we all... well getting close to xmas now so wish everyone the best.
i have to following function
function readTemplate($path, $filename)
{
$contents = '';
if (!$handle = @fopen($path . $filename, 'rb'))
{
$_SESSION['error'] = 'Cannot open file ' . $path . $filename;
return false;
}
$contents = fread($handle, filesize($path . $filename));
fclose ($handle);
return $contents;
}
curious is it ok to use the var $_SESSION['error'] for error display messages as i dont want it to just echo the message out when it fails as i want to be able to display that else where inside my template.
i dont want to use globals and i cant think of a better way just wondering what some of the more experienced coders think / would do.
thanks