Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

<?php $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

Works great! I just need help writing some code to prevent it sending if
I am the visitor on my site.
Thank you so much,

Re: codeing

Quoted text here. Click to load it you know your IP address/hostname?

if ($hostname !=3D $my_hostname)


if ($_SERVER['REMOTE_ADDR'] !=3D $my_ip)

I'm not sure WHY you're doing this, when this would do basically the
same thing:

# assumptions...your web log starts with IP addr followed by a space
# your nslookup command looks like "name = hostname", not "Name:
# your mileage may vary

ips=3D`cat /path/to/access_log | awk '{ print $1 }' | sort -u`;
for ip in $; do
  echo $ip | mail -s `nslookup $ip | grep "name" | sed 's/.*name = \(.*
\)\.//'` my@email.addr;

...but you could run it once every time your logs rotate instead of
slowing down every page connection...unless for some reason you want
an email every time someone loads the page...your call


Re: codeing

On Fri, 09 Oct 2009 14:00:01 -0700, matt wrote:

Quoted text here. Click to load it

Thanks a bunch Matt...I am just testing for a while to get some sort of
idea of ratio between bots and people....anyway thanks for the help,

Site Timeline