lunes, 18 de mayo de 2009

Home » » IP format GB to IP normal (reverse)

IP format GB to IP normal (reverse)

 

function ip_address_to_number($IPaddress)
{
if (
$IPaddress == "") {
return
0;
} else {
$ips = split ("\.", "$IPaddress");
return (
$ips[0] + $ips[1] * 256 + $ips[2] * 256 * 256 + $ips[3] * 256 * 256 * 256);
}
}

function
number_to_ip_adress($IPaddress){

if (
$IPaddress == "") {
return
0;
} else {
$ip4=floor($IPaddress/pow(256,3));
$ip3=floor(($IPaddress%pow(256,3))/pow(256,2));
$ip2=floor((($IPaddress%pow(256,3))%pow(256,2))/pow(256,1));
$ip1=floor(((($IPaddress%pow(256,3))%pow(256,2))%pow(256,1))/pow(256,0));

return (
$ip1.'.'.$ip2.'.'.$ip3.'.'.$ip4);
}

}


if(isset(
$_GET[IP])){
echo
$_GET[IP];
echo
'
'
;
echo
ip_address_to_number($_GET[IP]);
}

if(isset(
$_GET[NUM])){
echo
$_GET[NUM];
echo
'
'
;
echo
number_to_ip_adress($_GET[NUM]);
}
?>





HOW TO USE:
IP to IP GB

asasd.com/myscript.php?IP=123.258.254.214

IP GB to IP

asasd.com/myscript.php?NUM=2147483647

uhmmm i need help to restore my "IPBLOCK" table to ban accounts by IP
and make a script to register with automatic Country
Share this games :

0 comentarios :

Publicar un comentario