Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 12-29-2006, 10:16 AM   #1 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default ISP Name from IP address

hi guys,

its been long since i visited this forum, but i always return when things gets tougher for me(mind it for me and not for you guys )


well this time, i m here to ask you, how can i fetch an ISP name from the given IP address, i looked around the google, found 2-3 sites, but they all are paid, is there any way else to do that ??

I m using php

thanks a lot guys
__________________
Realin Wuz here ...

real_in is offline  
Old 12-29-2006, 06:28 PM   #2 (permalink)
 
Wizard Techie

Join Date: Oct 2004

Posts: 4,003

Trifid is on a distinguished road

Default

http://www.network-tools.com/

http://www.dnsstuff.com/

Off the top of my head.

Those get who are my internet provider(Enta), but I go through a reseller, which those sigs pick it up (Aquiss)
__________________

Cisco CCNA, Comptia A+
Trifid is offline  
Old 01-04-2007, 02:27 PM   #3 (permalink)
 
Newb Techie

Join Date: Jan 2007

Posts: 25

ryno

Default

Lets see. My php is a little rusty, but I think the following might do what you need.

$strHost = gethostbyaddr($_SERVER['REMOTE_ADDR']);

In my case, this would return something like...

UNIQUEHASH-UNIQUEHASH.cpe.net.cable.rogers.com

I would imagine what you want is just the rogers or the rogers.com. You can perform some string manipulation functions on $strHost to retrieve that.
ryno is offline  
Old 01-04-2007, 02:32 PM   #4 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

thanks mate, gonna try this in a min
__________________
Realin Wuz here ...

real_in is offline  
Old 01-04-2007, 02:38 PM   #5 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

Warning: gethostbyaddr() [function.gethostbyaddr]: Address is not a valid IPv4 or IPv6 address

mate this the error i got .. my simple code was

<?php

echo gethostbyaddr($_server['REMOTE_ADDR']);

?>


when i tried it on local server, it gave my my computer name, but when i put it online, it gave me this error..
__________________
Realin Wuz here ...

real_in is offline  
Old 01-04-2007, 02:41 PM   #6 (permalink)
 
Newb Techie

Join Date: Jan 2007

Posts: 25

ryno

Default

Lets try to debug this. Output $_SERVER['REMOTE_ADDR'] by itself and post the result.
ryno is offline  
Old 01-04-2007, 02:47 PM   #7 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

here is how i changed the code..

<?php

$ip=$_SERVER['REMOTE_ADDR'];
echo"you ip adddress is".$ip;
$isp=gethostbyaddr($ip);
echo $isp;
?>


and the output i got is

you ip adddress is **.**.177.233 **.**.177.233


that means it is returning me the ip address again, instead if ISP name ..
__________________
Realin Wuz here ...

real_in is offline  
Old 01-04-2007, 02:51 PM   #8 (permalink)
 
Newb Techie

Join Date: Jan 2007

Posts: 25

ryno

Default

Hmmm. Can I have the address where you're testing that? It's either just your ISP (hopefully) or a DNS setting on your hosts network.
ryno is offline  
Old 01-04-2007, 02:53 PM   #9 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

try here what result you get..

http://realin.co.in/sig/try.php
__________________
Realin Wuz here ...

real_in is offline  
Old 01-04-2007, 02:56 PM   #10 (permalink)
 
Newb Techie

Join Date: Jan 2007

Posts: 25

ryno

Default

you ip adddress is *.*.9.149 SNIP-SNIP.cpe.net.cable.rogers.com

I snipped out my identification, but it seems to work just fine for me.
ryno is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On