title: Login logout in smarty
body: <p>I have written the header.tpl and login.php file in smarty.  i want to show the logout text if user  is logged  in. otherwise it should show login if user is not logged in.below is the code of login.php</p>
  
  <pre><code>if(isset($_REQUEST['submit']))
      {
          $name=$_REQUEST['name'];
          $pass=$_REQUEST['pass'];
      $rs=mysql_query("select * from form where name='$name'");
      $fetchdata=mysql_fetch_array($rs);  
          if($rs)
          {
              $name=$fetchdata['name']
              $_SESSION['name']=$name;
              $name1=$_SESSION['name'];
              //$smarty-&gt;assign('name',$_SESSION['name']);
              $smarty-&gt;assign('name1',$name1);
              $smarty-&gt;display("about.tpl");
  
          }
          else
          {
              $smarty-&gt;display("login.tpl");
          }
      }
  </code></pre>
  
  <p>below is the header.tpl code</p>
  
  <pre><code>&lt;a href="login.php"&gt;{if $name1!= ''}: Logout{else}login{/if}&lt;/a&gt;
  </code></pre>
  
  <p>it is showing error</p>
  
  <pre><code>Parse error: syntax error, unexpected T_VARIABLE in D:\xampp\htdocs\smarty\login.php on line 29
  </code></pre>