IP address checker script
PHP script — By Script on September 18, 2009 at 12:38 pmYou need to know your IP address before checking anonymity. If you have only one server it’s not a problem. Hardcode and forget. But what if you have several servers? As I said before, automation is the king.
Say thank you to people who cares about us. Grab URL(s) you like, extract IP and be happy. The WhatIsMyIp class (whatismyip.php) will help you in the beginning.
-
<?php
-
class WhatIsMyIp {
-
private function extractIpAddress($text) {
-
"/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/",
-
$text, $matches)) {
-
$ip = $matches[0];
-
}
-
return $ip;
-
}
-
-
public function getServerIpAddress() {
-
return $this->extractIpAddress($file);
-
}
-
}
-
?>




(4 votes, average: 4.5 out of 5)
Tweet This
Share on Facebook
Digg This
Bookmark
Stumble2_03.gif)
1_03.gif)
0 Comments
You can be the first one to leave a comment.