smarty, include und sessions ??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • smarty, include und sessions ??

    also hab folgendes problem: ich arbeite mit smarty und möchte gerne im template eine if abfrage einbauen die erkennt ob man eingeloggt ist oder nicht. und je nachdem ein anderes template includet..
    naja funktioniert eiglt auch bis auf dass: sobald sich die session ändert, d.h. session_destroy(); immernoch das gegenteil angezeigt wird(also dass ich immernoch eingeloggt bin), bis ich das template mit der if abfrage neu hochlade, obwohl in der index.php keine session mehr angezeigt wird(testabfrage)..
    weis einer vllt woran das liegt? am code kann nich liegen denke ich naja hier trotzdem der code:
    die template..:
    PHP Code:
    ...
    <
    td background="img/layout/table_05.gif">
              
               {
    php}
               if(isset(
    $_SESSION['username'])) {
                include(
    'templates/log_out.tpl');
               } else {
                include(
    'templates/log_in.tpl');
               }
               {/
    php}
                  
    </
    td>
    ... 
    die index.php
    PHP Code:
     include('include/vars.php');
     include(
    'include/setup.php');
     
    $smarty = new Smarty_template;

     echo 
    $username;
     
     
    $smarty->display('index.tpl'); 
    1123581321

  • #2
    hat sich erledigt, habe einfach ans ende der datei geschrieben, dass der gesamte cache gelöscht werden soll
    1123581321

    Comment

    Working...
    X