Page 1 of 1
Referer Data - Please HELP.
Posted: Fri Aug 08, 2003 11:27 pm
by andrewt
Hi Guys,
Would it be possible to grab some back-end data,
eg ip address, FQN of referers site?
Thanks bunch...
Andrew
Posted: Sat Aug 09, 2003 7:38 am
by Kriek
See
Predefined Variables associated with the $_SERVER superglobal array.
Code: Select all
<?php
/*
The address of the page (if any) which referred the user agent to the current
page. This is set by the user agent. Not all user agents will set this, and some
provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really
be trusted.
*/
echo $_SERVER['HTTP_REFERER'];
/*
The IP address from which the user is viewing the current page.
*/
echo $_SERVER['REMOTE_ADDR'];
/*
Contents of the User_Agent: header from the current request, if there is one.
This is a string denoting the user agent being which is accessing the page. A
typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586). Among other things,
you can use this value with get_browser() to tailor your page's output to the
capabilities of the user agent.
*/
echo $_SERVER['HTTP_USER_AGENT'];
?>