G
G
ggagnidze2012-07-17 13:24:02
PHP
ggagnidze, 2012-07-17 13:24:02

How to do a search for source_ip in the database?

Good day.

There is a need to issue different links depending on which ip the user came from.
The correspondence "IP range" - "Where to send" is entered manually (geoip will not help).

In this regard, the question is:

1. Is there a PHP module that allows you to check whether an IP is in a range of addresses?
2. How to store the IP range in this case? 192.168.0.0-192.168.0.255 or 192.168.0.0/24 or something else?

Thanks

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
winbackgo, 2012-07-17
@winbackgo

Here , in the comments, in my opinion there is what you need (2nd comment).

A
Alexey Zhurbitsky, 2012-07-17
@blo

2. Two fields (from and to) INT(10) UNSIGNED in INET_ATON
format 1. Normal comparison ( example )

G
ggagnidze, 2012-07-28
@ggagnidze

Same question for IPv6. Let me remind you that it is also necessary to compare whether the given IP is in the range.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question