Hi folks
I'm trying to find a way of logging unauthorised attempts to access the secure part of a site that I run.
Story so far:
- .htaccess, etc. in place and working well for the /secure directory
- custom 401 (etc.) pages in place
I'd put a bit of code into the custom 401 page so that it would send me an e-mail whenever an attempt was made to login (with details of the login ID used by the person attempting to login along with the time/date and their IP).
I thought this was fine, but unfortunately I've found out that it actually e-mails me every time someone logs into the site! I'm guessing it must parse the 401 error page in preparation when it pops up the id/pwd HTTP-AUTH login box, hence generating an e-mail (which is blank with regards ID).
Does anyone know how I can modify things so that only failed login attempts generate an e-mail rather than all of them?
Thanks
Alan