koolgirl Posted May 2, 2006 Share Posted May 2, 2006 Hi again everyone,I just wanted to start collecting the information about the visitors by myself without depending on 3rd parties to do it for me. So I wrote this: ************************************************* <?php$dbcnx = @mysql_connect('mysql','login','password');mysql_select_db("MainDB");$sql = "INSERT INTO UserRecords SET " ."IP='$REMOTE_ADDR', " . "BrowserName='$HTTP_USER_AGENT', " ."Language='$HTTP_ACCEPT_LANGUAGE', " . "Referer='$HTTP_REFERER', " . "Date=CURDATE()";if (mysql_query($sql)) {echo("");} else {echo("<P>Error processing your request: " .mysql_error() . "</P>");}?>*****************************************************Everything works fine with the above code and it updates the fields at the database table correctly. The only field that does not get updated is the Referer field. As far as I know $HTTP_REFERER should take care of it. But it doesn't. Can anyone help me solve the problem? And of course if somebody can suggest which other information should I get if this is not enough?All help would be Very Very much appreciated Quote Link to comment Share on other sites More sharing options...
.josh Posted May 2, 2006 Share Posted May 2, 2006 well just so you know, it may be working just fine. from the manual:'HTTP_REFERER' 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.here is a list of the reserved variables you may wanna look at:[a href=\"http://us2.php.net/reserved.variables\" target=\"_blank\"]http://us2.php.net/reserved.variables[/a] Quote Link to comment Share on other sites More sharing options...
koolgirl Posted May 2, 2006 Author Share Posted May 2, 2006 Thanks again Guru,I got it now and the link that you gave is exactly what I had been looking for. Have a nice day! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.