title: Can't use function return value in write context
body: <p>Ok, here is my code. What it is supposed to do is retrieve the referer that sent you to the page, the user will type someurl.com/refcreate.php?ref=username</p>
  
  <pre><code>&lt;?php
  session_start();
  
  $referer = $_GET['ref'];
  $_SESSION['referer'] = $referer;
  
  if (!isset($referer))
  {
      echo 'You did not specify a referer, please correct this to continue';
      die;
  }
  elseif($referer == "")
  {
      echo 'You did not specify a referer, please correct this to continue';
      die;
  }
  </code></pre>
  
  <p>The above part works fine if they forgot to specify the referer. The below half is to check if the current referer specified is an actual user in the database.</p>
  
  <pre><code>if(refcheck($referer) = false)
      {
          echo 'that referer is not in our database,please double chek the spelling and try again.';
          die;
      }
  
      function refcheck($ref)
      {
          require('mysql_con.php');
  
          $query="SELECT username FROM jos_users WHERE username='". $ref ."'";
          echo $query;
          $result = mysql_query($query, $con);
          $exists =mysql_fetch_assoc($result);
          if ($exists != false)
          {
              //return true;      
              echo 'true';    
              return true;
  
          }
  
          require('mysql_close.php');
      }
      ?&gt;
  </code></pre>
  
  <p>OK, I figured out the problem (or problems rather). 1 was it needed to look like this <code>if(refcheck($referer) == false){}</code> instead of <code>if(refcheck($referer) = false);</code>. So it was a missing equal sign and a misplaced colon :P thanks guys </p>