The Referer is completely client-dependant in if it's sent, what it sends etc. You shouldn't trust user input if you have to be sure of something.
edit: Woops, this should've been an answer to marto.
Ordinary morality is for ordinary people. -- Aleister Crowley
Reparented from Checking Referring Page? by Arunbear