Forum Moderators: coopster & phranque

Message Too Old, No Replies

MSN and Yahoo HTTP_USER_AGENT in script.

         

Jesse_Smith

9:40 am on Apr 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How would I change this code to also log MSN and Yahoo, along with Google?

if ($ENV{'HTTP_USER_AGENT'} =~ /google/) {
open (DATABASE,">>$database");
print DATABASE "$ENV{'REMOTE_ADDR'} - $ENV{'HTTP_USER_AGENT'} - $ENV{'HTTP_REFERER'} - $shortdate\n";
close(DATABASE);
}

wruppert

1:03 pm on Apr 28, 2005 (gmt 0)

10+ Year Member



Replace /google/ with /(google¦msn¦yahoo)/.

The "¦" symbols are supposed to be the solid vertical bar, not the broken vertical bar. The forum software changes it.

rocknbil

3:41 pm on Apr 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may want to also make it case insensitive.
/(google¦msn¦yahoo)/i