Hi, I log all the referrers on my index. I looked at a few, and they come up as: XXXX:+++++++++++++++++++++++++++++++++
Any ideas what this is?
Modified referrer porn site?
Lol
| SitePoint Sponsor |




Hi, I log all the referrers on my index. I looked at a few, and they come up as: XXXX:+++++++++++++++++++++++++++++++++
Any ideas what this is?
Modified referrer porn site?
Lol
Not trying to hijack the thread! But curious, is this a hard thing to set up? I'd like to log my referrers as well. Thanks![]()




If you know the basics of MySQL & PHP, it's insanely easy.
I made a table with the following:
CREATE TABLE `referrers` (
`id` int(255) NOT NULL auto_increment,
`referrer` text NOT NULL,
`ip` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
)
Then at the top of any page, put:
PHP Code:<?PHP
// MYSQL connection goes here//
$ip = $_SERVER['REMOTE_ADDR'];
$referrer = $_SERVER['HTTP_REFERER'];
mysql_query("INSERT INTO referrers (referrer, ip) VALUES ('$referrer', '$ip')");
mysql_close;
?>




Forgot to note, PHP.net says HTTP_REFERER really can't be trusted




Lol, funny, I was so sure referer (in HTTP_REFERER) was spelled referrer, so i checked it in dictionary.com, this is what it said:
A misspelling of "referrer" which somehow
made it into the HTTP standard. A given web page's
referer (sic) is the URL of whatever web page contains the
link that the user followed to the current page. Most
browsers pass this information as part of a request.
Lol





I used to get the same thing on a site I ran before! Im sure it was so kind of 'unfriendly' site! Like you say, could be a porn site! Do you still get an IP address inserted into your log?
Mark
Thanks manI'm gunna check this out today.
Now.. it stores an IP it would appear. Is this the users or the servers they are coming from? I assume the servers, but at some point soon I'll also need to start logging the users. Just as easy?





Its the IP address the user is browsing with, However if they are on dialup it will change a lot.
Mark
Bookmarks