Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Very Simple PHP Question

Posted on 2004-08-06
1
Medium Priority
?
447 Views
Last Modified: 2006-11-17
When I go to IPCHICKEN.com it displays my IP: 69.3.28.xxx . It also displays this: h-69-3-28-xxx.snvacaid.dynamic.covad.net . IPCHICKEN refers to that as the "name address." I've seen many sites do the same thing and display the "name adress."

MY QUESTION IS: How do u display the "name address" in PHP.

BTW, I already know how to display the IP: $_SERVER["REMOTE_ADDR"]. Could u tell me how to display the name adress in this format, if it is possible.
0
Comment
Question by:andrey_2007
1 Comment
 

Accepted Solution

by:
Tomex earned 800 total points
ID: 11739475
You need to feed the gethostbyaddr() function the IP address eg:

<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
 
echo $hostname;
?>
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Introduction to Processes
Screencast - Getting to Know the Pipeline

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question