title: Webpage Title user name
body: <p>I want to put the name of the loggedin user as the title of the page. But I've no idea how to do it. I've tried several ways but each one show a parse error. here is my php code for logging in the user and then showing his details.</p>
  
  <pre><code>&lt;?php
  
                  //if the login session does not exist therefore meaning the user is not logged in
                  if(strcmp($_SESSION['uid'],"") == 0){
                      //display and error message
                      echo "&lt;center&gt;You need to be logged in to user this feature!&lt;/center&gt;";
                  }else{
                      //otherwise continue the page
  
                      //this is out update script which should be used in each page to update the users online time
                      $time = date('U')+50;
                      $update = mysql_query("UPDATE `employer` SET `online` = '".$time."' WHERE `id` = '".$_SESSION['uid']."'");
                      $display_query = mysql_query("SELECT * FROM employer WHERE `id` = '".$_SESSION['uid']."'");
                      echo "&lt;table id='pageTable'&gt;&lt;tbody&gt;&lt;th&gt;Your Details&lt;/th&gt;";
                      echo "&lt;tbody&gt;";
                      while($row = mysql_fetch_array($display_query)){
                          echo "&lt;tr&gt;&lt;td&gt;Name&amp;#58;&amp;nbsp;&lt;/td&gt;&lt;td&gt;".$row['name']."&lt;/td&gt;&lt;tr&gt;";
                          $titlename = $row['name'];
                          echo "&lt;tr&gt;&lt;td&gt;E&amp;#45;Mail ID&amp;#58;&amp;nbsp;&lt;/td&gt;&lt;td&gt;".$row['email']."&lt;/td&gt;&lt;tr&gt;";
                          echo "&lt;tr&gt;&lt;td&gt;Contact No&amp;#46;&amp;#58;&amp;nbsp;&lt;/td&gt;&lt;td&gt;".$row['contact']."&lt;/td&gt;&lt;tr&gt;";
                          echo "&lt;tr&gt;&lt;td&gt;Company&amp;#58;&amp;nbsp;&lt;/td&gt;&lt;td&gt;".$row['company']."&lt;/td&gt;&lt;tr&gt;";
                          echo "&lt;tr&gt;&lt;td&gt;Designation&amp;#58;&amp;nbsp;&lt;/td&gt;&lt;td&gt;".$row['designation']."&lt;/td&gt;&lt;tr&gt;";
                      }
  
                      echo "&lt;/tbody&gt;";
                      echo "&lt;/table&gt;";
                      echo "&lt;table&gt;&lt;tr&gt;&lt;td&gt;";
                      echo '&lt;div class="button"&gt;&lt;a href="functions/logout.php"&gt;Logout&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;';
  
  
                  //make sure you close the check if they are online
                  }
  
              ?&gt;
  </code></pre>
  
  <p></p>