prova con:
Codice PHP:
if (isset ($_SERVER ['HTTP_REFERER'])){