ip and host name

3 отговора 115 прегледа
#1

ip and host name

как мога от IP адрес да получа името на хоста, например
64.58.76.179 [линк]
194.145.63.12 [линк]

[email protected]

Отговор
в отговор на theacher #2

Re: ip and host name

gethostbyaddr

по добре да мълча и да изглеждам глупав, отколкото да си отворя устата и да го докажа
Отговор
в отговор на theacher #3

Re: ip and host name

<?

if(!empty($host))
{
$a = gethostbyname($host);
echo "<center>IP for <b>$host </b> is <b> $a </b></center>";
}
if(!empty($ip))
{
echo $host = gethostbyaddr($ip);
echo "
".gethostbyname($host);
}
?>

<form method=post>
<table align=center>
<tr>
<td>IP address: </td>
<td><input type=text name=ip></td>
</tr>

<tr>
<td>Web address: </td>
<td><input type=text name=host></td>
</tr>

<tr>
<td colspan=2 align=center>
<input type=submit name=submit value=check>
</td>
</tr>
</table>
</form>

Отговор
в отговор на $burov #4

Re: ip and host name

благодаря на всички

Отговор