|
|
|
Problem
======
I placed this on my webpage:
echo $REMOTE_HOST . "," . $REMOTE_ADDR;
and all I get is the IP address but not the Hostname.
Solution
======
You're not doing anything wrong - hostname lookups are turned
off by default in BestHost setups - that DNS lookup can slow
your site down by 20% or more.
Try doing a gethostbyaddr() call on the contents of $REMOTE_ADDR;
http://us.php.net/manual/html/function.gethostbyaddr.html
Support
BestHost - - Circle Net, Inc.
|
|
| The following snippet gives complete info about all submitted
HTTP_POST_VARS and HTTP_GET_VARS Categories : Variables, HTTP, PHP | | | Simple Password example Categories : PHP, Authentication, Security, HTTP | | | How can I know about what Operating System is running on server from
PHP? Categories : PHP, Global Variables | | | getting the name of the current script and query string Categories : PHP, Global Variables, Variables, URLs | | | WebServerSpy checks which kind of Webserver is running, Apache, Netscape, Fasttrack, IIS, HTTP-Header, HTTP 1.0, GET, spy, WWW Categories : HTTP, Network, Apache, PHP, Web Servers | | | This gets the http response headers for a given url and returns them in an assoc array. i.e. to test if a url exists: $array = get_http_headers($url); if($array[result]=200) { } Categories : HTTP, Arrays, PHP | | | Gets the browser and OS from the $_SERVER['http_user_agent'] variable in PHP Categories : PHP, HTTP, Regexps | | | A function to check if a URL exists Categories : PHP, CURL, HTTP | | | PHP4 HTTP Compression Speeds up the Web Categories : PHP, Zlib, HTML and PHP, HTTP, Network | | | Simple pipe delimited file export program that downloads to a local machine Categories : PHP, Filesystem, Databases, MySQL, HTTP | | | Authentication HTTP protocol POST Categories : Authentication, HTTP, PHP | | | Class that allows the PHP developer to create and manage UNIX like password files suitable for use as Apache authentication password files.
Categories : HTTP, PHP, PHP Classes, Filesystem | | | Remote File Saving with PHP - Download and serve a remote file. The content of the file will be updated at fixed intervals. Categories : PHP, Filesystem, Cache, Sockets, HTTP | | | Remote File Size Categories : PHP, Filesystem, HTTP, Sockets | | | HTTP Basic Authentication via POP3. Categories : Authentication, HTTP, Email, PHP | |
| | | | 420 wrote : 353
Here ya go bro!
<?php
$hostname = getenv("REMOTE_HOST");
$ipaddress = getenv("REMOTE_ADDR");
print "Host Name: $hostname";
print "IP Address: $ipaddress";
?>
| | | | Maxim Maletsky wrote : 436
I actually like Yahav`s code better, because most of the users already have IP detected and an assigned variable to it, so why to get it once more when you have it already, the getenv is too simple and has more need of playing around then gethostbyaddr();
Cheers!
| | | | qw Fu wrote :777
I did make a Java applet to access the remote MySQL server. It works in local machine`s JBuilder environment, however, it couldn`t connect to the MySQL in the designated host machine with TCP/IP. The return infomation is as the following:
"can not connect to MySQL in HOSTNAME:3306. The MySQL is not installed or not running (java.security.AccessControlException)"
Please give some direction. If you can email to qingwei_f@yahoo.com, I`d more greatly appreciate it.
David Fu
| |
|
|
|