Date: 12/06/00
- Next message: Sascha Schumann: "[PHP-DEV] Macro Expansion Problem"
- Previous message: Chuck Hagenbuch: "[PHP-DEV] crash in sablotron module"
- Maybe in reply to: Samuel Desramont: "[PHP-DEV] === REMOTE_DOMAIN ==="
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Addressed to: "Samuel Desramont" <sdesramont <email protected>>
php-dev <email protected>
** Reply to note from "Samuel Desramont" <sdesramont <email protected>> Wed, 6 Dec 2000 16:51:47 -0000
>
> Hi,
>
> I would like to get the remote domain of a client visiting my
> website. How can I ?
>
> I've found the way to get the IP address
> ($IP_addr=getenv("REMOTE_ADDR");) but not the remote domain.
>
This list is for the development of PHP, rather than its usage. If you
have further questions please submit them to the php-general list, or
one of the other lists at:
http://www.php.net/support.php
In answer to your question, take a look at:
http://www.php.net/manual/html/function.gethostbyaddr.html
You don't need to use getenv() with php, the $REMOTE_ADDR variable
should already be defined in the global context. If you want to see it
from inside a function, you will need to use a global declaration.
You might be able to enable hostname lookups on your web server and use
the HTTP_HOST variable, but unless you need it on every page served it
is a waste of time.
Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Sascha Schumann: "[PHP-DEV] Macro Expansion Problem"
- Previous message: Chuck Hagenbuch: "[PHP-DEV] crash in sablotron module"
- Maybe in reply to: Samuel Desramont: "[PHP-DEV] === REMOTE_DOMAIN ==="
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

