Codice PHP:
$referer explode('?' $_SERVER['HTTP_REFERER']);

basename($referer[0]); 
ti taglia via tutte le variabili....