| 
	
 | 
 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
 
  
Navigation:
[Reply to this message] 
 |