|
Posted by Steve on 11/14/05 10:38
In article <zzadf.5300$Lv.1907@newssvr23.news.prodigy.net>,
mazin07@gmail.com (Mazin07) wrote:
> *Subject:* Get HTTP Response Code
> *From:* Mazin07 <mazin07@gmail.com>
> *Date:* Sat, 12 Nov 2005 00:20:47 GMT
>
> Is there any way to get the HTTP Response Code sent out by the server
> (ie 404, 302, etc)?
>
> Or could I just assume that the same code was sent?
>
> I know the $_SERVER array has a lot of info, but this isn't in there.
>
> I'm trying to create my own text logs here.
>
I have a little script running in my custom error pages. 404.php,
403.php and 500.php.
If you can have custom error pages then you could do the same. I save
the IP, date, time, and referring page. That way, I get an idea of what
is broken or what was being attempted. (Usually virus activity which of
course has no referer.)
It just saves me going through the main site logs.
500 : 128:Sun, 13 Nov 2005 11:19:18 +0000:211.20.54.196:211.20.54.196 :
gives me error code, how many times that code has been hit, date - time,
IP, and gethostbyaddr obviously didn't resolve.
A quick look at the main log shows it was a virus attack.
211.20.54.196 - - [13/Nov/2005:11:19:15 +0000] "GET
//cgi-bin/awstats/awstats.pl HTTP/1.1" 500 659 "" "Mozilla/4.0
(compatible; MSIE 6.0; Windows 98)"
Is that what you meant ???
- Steve
Navigation:
[Reply to this message]
|