Witam! Mam problem czesto pojawiajacy sie, aczkolwiek, nie moge sobie poradzic. Pisalem kod z uzyciem sesji
<?
$DefaultCat = 'images';
define('SESSION_NAME', $_SESSION['name']); define('SESSION_USER', $_SESSION['user']); define('SESSION_CAT', $_SESSION['cat']); define('SESSION_FILE', $_SESSION['file']);
// LOADING CLASS5
require_once('class/class.directory.php');
require_once('class/smarty/Smarty.class.php');
echo SESSION_CAT
."1<br>";
if ( SESSION_CAT == '' ) {
$NameCat = $DefaultCat;
$_SESSION['cat'] = $NameCat;
}
else {
$NameCat = SESSION_CAT;
}
if ( SESSION_USER == '' ) {
$UserName = 'Gość';
}
else {
$UserName = SESSION_USER;
}
// START FTPSTRUCT CLASS
$directory = new FtpStruct ($NameCat);
$directory->ReadDirectory();
$directory->SortFiles();
$files = $directory->ShowFiles();
$path = $directory->GetPath();
$icon_file = array('zip' => 'icon_zip.gif', 'exe' => 'icon_exe.gif',
'txt' => 'icon_txt.gif',
'dir' => 'icon_dir.gif',
'pdf' => 'icon_pdf.gif',
'' => 'icon_def.gif');
// LOADING TEMPLATE
$smarty = new Smarty();
// katalog szablonów
$smarty->template_dir = 'templates/';
// katalog na skompilowane szablony
$smarty->compile_dir = 'templates_c/';
// katalog na cache
$smarty->cache_dir = 'cache/';
$smarty->display('header.tpl');
$smarty->assign('list', $files);
$smarty->assign('path', $path);
$smarty->assign('icon', $icon_file);
$smarty->assign('UserName', $UserName);
$smarty->assign('FileLimit', SESSION_FILE);
$smarty->assign('NameCat', $NameCat);
$smarty->display('index.tpl');
$smarty->display('footer.tpl');
$_SESSION['name'] = 'kamil';
$_SESSION['user'] = 'camikazee';
?>
mozna zauwazyc, ze juz powtykalem w niektorych miejscach sprawdzenie czy i gdzie gubia sie zmienne w sesji, ale w tym miejscu wszystkie sa
dopiero gdy uruchomie strone np.
<?
?>
otrzymuje w wyniku puste pola, gdzie ja robie blad?