Jump to content

Archived

This topic is now archived and is closed to further replies.

Unfamiliar

Simple but confusing

Recommended Posts

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

 

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

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

[!--quoteo(post=336076:date=Jan 13 2006, 02:07 AM:name=unfamiliar)--][div class=\'quotetop\']QUOTE(unfamiliar @ Jan 13 2006, 02:07 AM) 336076[/snapback][/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;
?> 

 

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");

 

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.