I looked in the PHP manual but I could not find anything about checking to see if you reached a page from a certain url.
if it is in the manual then I don't know what to look under.

I there any way to check if a page has been visited from a specific URL.

i.e.

if url = "http://someurl.com/thispage.php

then

some output

else

"You reached this page illeagaly please go back"