|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
This is probably a more appropriate question for comp.lang.php but I like
you guys better. I'm looking for a way - using PHP - to get *only* the abuse contact for an IP address. Anyone know how to do this? TIA -- Karl Groves http://www.WebAccessStrategies.com |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
And lo, Karl Groves didst speak in alt.www.webmaster:
> This is probably a more appropriate question for comp.lang.php but I like > you guys better. > > I'm looking for a way - using PHP - to get *only* the abuse contact for > an > IP address. Anyone know how to do this? Assuming a *nix server with shell access to the whois command, try this on for size: <?php if (isset($_GET['ip']) && preg_match("/(\d{1,3}\.){3}\d{1,3}/", $_GET['ip'])) { echo "Checking {$_GET['ip']} . . .\n"; if (preg_match("/(abuse@[\S]+)/i", `whois {$_GET['ip']}`, $match)) { $abuse = $match[1]; echo "Abuse email address: $abuse"; } else echo "No abuse email address found"; } else echo "Invalid IP or No IP Given"; ?> The script will accept IPs sent via HTTP in the form: /abuse.php?ip=123.123.123.123 Modify as you see fit. Note the IP regular expression is a simple one which will also allow IPs like 999.999.999.999 to get through. Grey -- The technical axiom that nothing is impossible sinisterly implies the pitfall corollary that nothing is ridiculous. - http://www.greywyvern.com/orca#search - Orca Search: Full-featured spider and site-search engine |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
GreyWyvern <spam@greywyvern.com> wrote in
news p.tyhzq1jlsl6xfd@news.nas.net:> And lo, Karl Groves didst speak in alt.www.webmaster: > >> This is probably a more appropriate question for comp.lang.php but I >> l > ike >> you guys better. >> >> I'm looking for a way - using PHP - to get *only* the abuse contact >> fo > r >> an >> IP address. Anyone know how to do this? > > Assuming a *nix server with shell access to the whois command, try > this on for size: > HAWT. Thanks! -- Karl Groves http://www.WebAccessStrategies.com |
|
![]() |
| Outils de la discussion | |
|
|