How can you show the viewers ISP in php?
Thanks.
How can you show the viewers ISP in php?
Thanks.
Edited by Catzsy Forum Super Moderator: Your signature has been removed because
It is against the rules to insult/bully other members by targetting them with personal remarks about them in your signature.
Do you mean something like this? Or do you mean like actually show the name e.g: Virgin Media ?
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$isp = @getHostByAddr( $ip );
print $isp
?>
?
I will try again to post, everytime I try a message comes up for like 1 second then disappears.. :S.
Do you want something like this or, the actual ISP's name like Virgin Media?
That prints out some address that has the ISP in it..?PHP Code:<?php
$ip = $_SERVER['REMOTE_ADDR'];
$isp = @getHostByAddr( $ip );
print $isp
?>
I think I can post now lol.
Anyway is it like this you want? Or the actual ISP name?
This is about the 5th time I've tried to post this :\ keep getting a error message about a MOD needs to approve it.PHP Code:<?php
$ip = $_SERVER['REMOTE_ADDR'];
$isp = @getHostByAddr( $ip );
print $isp
?>
Edited By DaveTaylor// (Forum Moderator) Posts approved and merged.
Last edited by DaveTaylor; 03-07-2008 at 03:44 PM.
try thatPHP Code:<?php
$ip = "" . $_SERVER['REMOTE_ADDR'] . "";
$isptc = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$ispoh = preg_split("/./", $isptc);
$xy = count($ispoh);
$x = $xy - 1;
$y = $xy - 2;
$i = $xy - 3;
$ispp = "" . $ispoh[$i] . ".";
$isp = "" . $ispoh[$y] . "." . $ispoh[$x] . "";
echo"<b>ip: $ip</b><br>";
echo"<b>isp: $ispp$isp</b>";
?>
Your one just posts this:try thatPHP Code:<?php
$ip = "" . $_SERVER['REMOTE_ADDR'] . "";
$isptc = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$ispoh = preg_split("/./", $isptc);
$xy = count($ispoh);
$x = $xy - 1;
$y = $xy - 2;
$i = $xy - 3;
$ispp = "" . $ispoh[$i] . ".";
$isp = "" . $ispoh[$y] . "." . $ispoh[$x] . "";
echo"<b>ip: $ip</b><br>";
echo"<b>isp: $ispp$isp</b>";
?>
ip: XX.XX.XX.XX
isp: ..
ISP just has .. in it because my ISP Host name is Bethere.co.uk
Never argue with an idiot, he'll drag you down to his level, and beat you with experience.
And 15 mins later...Originally Posted by Recursion
*oh trust me
*I would NEVER go ATi
Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
*ordered.
Want to hide these adverts? Register an account for free!