PHP получите реферателя

// To get what website the user came from:
$_SERVER['HTTP_REFERER']
Klump