Retrieving referral url application
<p>Let say we've the following</p>

<p>Objective : User will post certain exact URL <code>$refere</code> to lock viewing text content and only be allowed for view if the viwer is coming from the same exact URL <code>$refere</code>.</p>

<pre><code>$refere = "http://www.site_site.com"; // User will post it
$r = $_SERVER['HTTP_REFERER']; // To get real referral
</code></pre>

<p>and i want to do the following</p>

<pre><code>&lt;?PHP

if(stripos($r, $refere) == false){

echo "Wrong";

} else { ?&gt;

echo "Go";

}

?&gt;
</code></pre>

<p>It always gives me <code>$r = $_SERVER['HTTP_REFERER'];</code> blank ! so does it deprecated on any PHP version 4 or 5 whatever !</p>

<p>Also</p>

<p>what is the user posted <code>$refere</code> like <code>https://</code> or missed <code>www.</code> or only posted <code>site_site.com</code> while the <code>$r = $_SERVER['HTTP_REFERER'];</code> showing <code>www.site_site.com</code></p>

<p>so can anyone help me to adjust this code to be working fine no matter the user posted the <code>$refere</code> link fully or only <code>site_site.com</code>.</p>
