|
Posted by Kimmo Laine on 02/23/07 05:14
xhe kirjoitti:
> Hi,
> I need to program to check the validity of IP address through PHP
> Initially I used this one:
>
> $url="http://www.ntc.gov.au/ViewPage.aspx?
> page=A02400304500100020";
>
> $fp=fopen($url,"r");
> if(!$fp)
> {
> echo "Failed";
> }else
> {
> echo "success";
> }
> when I run it, it's output is "Failed",
>
> I then use
>
> $fp=fsockopen($url,80); for second line, and also failed.
>
> This IP address is actually good.
> Butwhen I check "www.ntc.gov.au" it is success.
That's _not_ an IP address. IP is something like 12.34.56.78, four
groups of digits between 0-255 separated with dots (...and then there's
IPv6 address, which is six hexnumbers separated by a semicolon). What
you have there are an url and a domain.
check it out: http://en.wikipedia.org/wiki/IP_address
--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
[Back to original message]
|