Reply to Re: Script assistance, IP address related

Your name:

Reply:


Posted by Martin Mandl - m2m tech support on 02/09/07 06:23

On Feb 9, 4:23 am, endlesst...@gmail.com wrote:
> Hi, could someone please show me in PHP how to express a low and high
> IP address, and do something based on result?
>
> Like
>
> <?
>
> $start_ip_range = "202.100.100.100"
> $end_ip_range = "220.255.255.255"
>
> if $actual_ip_address between $start_ip_range and $end_ip_range
> {
> do something
>
> }
>
> ?>

Dear endless,

split your ip addresses (start_ip, end_ip, and actual_ip) into its
parts (e.g. with explode) and compare them.

Or create a hex representation of your addresses and compare them.

Or just remove the dots and compare the results.

Or just google to find a script ready to do that ;)

Good luck

------------------------------------------------
online accounting on bash bases
Online Einnahmen-Ausgaben-Rechnung
http://www.ea-geier.at
------------------------------------------------
m2m server software gmbh
http://www.m2m.at

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация