print_r($_SERVER):
to see some other variables
theres HTTP_REFERER but the browser doesnt always send that value.
but when that variable has a value, it can be used to both
-tell you where the user came from
-it might have some search terms in it
for example, you might see this as the referer
http://www.google.com/search?hl=en&q=foo&btnG=Google+Search
then just parse it to get what you want from it