Gossamer Forum
Home : Products : Links 2.0 : Customization :

Search Log

Quote Reply
Search Log
Is is possible to have the search log log the IP address of the person that makes each search?
Quote Reply
Re: Search Log In reply to
We have discussed about this topic in previous threads. Try searching for it.

John
Quote Reply
Re: Search Log In reply to
Well... maybe I'm searching for the wrong thing, but I can't seem to find it. I've tried searching in both forums. I would appreciate a URL since you know that it has been discussed before.
Quote Reply
Re: Search Log In reply to
Original Search Log mod at: http://www.bownnet.demon.co.uk/linksmods/searchlog.htm

Modify your search.cgi file by placing the following lines:

sub logsearch {

open (KEYWORDS, ">>$kword_file_name") or &cgierr("error in search. cannot open keyword file");
print KEYWORDS $in{'query'};
print KEYWORDS "\|";
print KEYWORDS $ENV{'HTTP_HOST'};
print KEYWORDS "\|";
print KEYWORDS $ENV{'REMOTE_ADDR'};
print KEYWORDS "\|";
print KEYWORDS &get_date;
print KEYWORDS "\|";
print KEYWORDS &get_time;
print KEYWORDS "\n";
close (DB);

}

FYI, 'REMOTE_ADDR' gets you the IP # of the searcher. See above.

If you want, you can also add 'REMOTE_HOST' for reverse lookup resolution.

Hope this helps.

John
Quote Reply
Re: Search Log In reply to
Hi John,

why

CLOSE (DB);

?

Shouldn't it read

CLOSE (KEYWORDS);

?

I also miss flock here.

I am no Perl Programmer, but it seems not very logical to me.

Regards

Michael