title: Fatal error: Can't use function return value in write context in C:\xampp\htdocs\IM\IMlogin.php on line 36
body: <p>Please help, where have i gone wrong..
  Every time i am getting this error message: <strong>Fatal error: Can't use function return value in write context in C:\xampp\htdocs\IM\IMlogin.php on line 36</strong></p>
  
  <pre><code>&lt;?php session_start() ?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;IM&lt;/title&gt;
  &lt;style&gt;
  
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h1&gt;&lt;b&gt;IM&lt;/b&gt;&lt;/h1&gt;
  
  &lt;form method="POST" action=""&gt;
      &lt;input type="text" name="name" placeholder="Enter Full Name" required&gt;&lt;br&gt;
      &lt;input type="text" name="id" placeholder="Enter ID" required&gt;&lt;br&gt;
      &lt;input type="text" name="pass" placeholder="Enter Password" required&gt;&lt;br&gt;
      &lt;input type="submit" name="login" value="LOGIN"&gt;
  &lt;/form&gt;
  &lt;?php
      $server = "localhost";
      $user = "root";
      $pass = "";
      $dbname = "infernomesenger";
      $con = mysqli_connect($server,$user,$pass,$dbname);
  
      if(isset($_POST["login"]))
      {
          $name = $_POST["name"];
          $id = $_POST["id"];
          $pass = $_POST["pass"];
          $cid = "karisgreat";
          $cpass = "karkpranam";
  
          if($id == $cid &amp;&amp; $pass == $cpass)
          {
              $_SESSION('loggedin') = true;
              $_SESSION('username') = $name;
              echo "&lt;script&gt;document.location.href = 'chatroom.php'&lt;/script&gt;";
          }
          else
          {
              echo "Wrong id or password";
          }
      }
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>