title: Referral URL in php
body: <p>So I am trying to get the page where a visitor came from. I inserted this code into a php file and I am trying to see the page's URL but it is not working, any suggestions?</p>
  
  <pre><code>&lt;?php 
  
    $ref = getenv("HTTP_REFERER"); 
    echo $ref; 
  
  ?&gt;
  </code></pre>
  
  <p>(added this after some answers)
  I have also tried</p>
  
  <pre><code>print $_SERVER["HTTP_REFERER"];
  </code></pre>
  
  <p>and that doesn't work either</p>
  
  <p>it worked after i updated the website many times, not sure why was there a problem in the first place, thanks anyway :) </p>