0

Hi all

i am tracing ip addresses of all the site visitor using $_SERVER; and its working fine, But i want to exclude all ip starting from 172.122.*.* . i want to put "if" condition but don't know how to track these first two figure.
can anyone please tell me how can i exclude ip addresses starting from 172.122.?

Many Thanks in advance.

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by xylude
0
$ip = $_SERVER['remote_addr'];
$firstDigits = substr($ip, 0, 8);
if($firstDigits != '172.122.') {
//do whatever
}

Hope that helps :)

0

oh my god

you are just master of masters , i was unable to solve the problem since last 6 months.
Big thanks to you bro. it worked great and solved my problem.

aaaah how relaxing is it now.

Thanks again.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.