Jump to content


Photo

Simple but confusing


  • Please log in to reply
3 replies to this topic

#1 Unfamiliar

Unfamiliar
  • Members
  • Pip
  • Newbie
  • 1 posts

Posted 13 January 2006 - 08:07 AM

I need a fix for this code so it displays other peoples service host

<?
$hostname = gethostbyaddr "60.228.82.14";
  
echo $hostname;
?> 


#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 13 January 2006 - 09:25 AM

Please read the description of the Core PHP Hacking forum, your post is not related at all. Please do be careful where you post in future, moving you topic to a more suitable forum...

#3 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 08 March 2006 - 03:52 AM

Try something like:
<?
$remoteip=$_SERVER['REMOTE_ADDR'];
$hostname = gethostbyaddr $remoteip;
  
echo $hostname;
?>

I'm not sure if that will work. I would test it but its very later here and im about to go to bed.

(if that doesnt work, try quotes around $remoteip)
Why doesn't anyone ever say hi, hey, or whad up world?

#4 greycap

greycap
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 08 March 2006 - 04:17 AM

[!--quoteo(post=336076:date=Jan 13 2006, 02:07 AM:name=unfamiliar)--][div class=\'quotetop\']QUOTE(unfamiliar @ Jan 13 2006, 02:07 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I need a fix for this code so it displays other peoples service host

<?
$hostname = gethostbyaddr "60.228.82.14";
  
echo $hostname;
?> 
[/quote]

echo and print are very unique in that they dont require parans (). Virtually every other function does.

you want:
$hostname = gethostbyaddr("60.228.82.14");





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users