Is is possible to have the search log log the IP address of the person that makes each search?
Dec 15, 1998, 12:36 PM
User (159 posts)
Dec 15, 1998, 12:36 PM
Post #4 of 5
Views: 521
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
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

