title: Trying to get user IP, referrer data in PHP- Why doesn't this code work?
body: <p>The following code:</p>
  
  <pre><code>&lt;?php
      // Get referrer:
      $ref=@$HTTP_REFERER; 
      echo "&lt;b&gt;Referrer of this page  = $ref &lt;/b&gt;&lt;br&gt;";
  
      // Get IP:
      $ip=@$REMOTE_ADDR; 
      echo "&lt;b&gt;IP Address= $ip&lt;/b&gt;&lt;br&gt;";
  ?&gt;
  </code></pre>
  
  <p>Returns:</p>
  
  <p><strong>Referrer of this page = <br>
  IP Address=</strong> </p>
  
  <p>Why wouldn't this work? Thanks-</p>