Re: Nombre del host remoto
| From: | Victor Ricardo Díaz | Date: | Wed, 26 Mar 2003 19:29:30 +0000 |
| Subject: | Re: Nombre del host remoto | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-34307@lists.php.net to get a copy of this message | ||
Creo que esto te sirva, para determinar el ip de la maquina que te hace el
request puedes utilizar
$_SERVER["REMOTE_ADDR"] , de paso te sirve para tomar algunas variables de
ambiente.
Ojo este es un script viejo cambiar $REMOTE_ADDR por $_SERVER["REMOTE_ADDR"]
como corresponde.
<?php
print "<HTML>\n";
print "<HEAD><TITLE>Examining Enviroment
Variables</TITLE></HEAD>\n";
print "<BODY bgcolor=#99CCFF><H1>Examining Enviroment Variables</H1>\n";
print "<HR><PRE>";
print "The server software is:
".$SERVER_SOFTWARE."<BR>\n";
print "The server hostname, DNS alias, or IP address is:
".$SERVER_NAME."<BR>\n";
print "The CGI specification revision is:
".$GATEWAY_INTERFACE."<BR>\n";
print "The name and revision of info protocol is:
".$SERVER_PROTOCOL."<BR>\n";
print "The port number for the server is:
".$SERVER_PORT."<BR>\n";
print "The info request method is:
".$REQUEST_METHOD."<BR>\n";
print "The extra path info is:
".$PATH_INFO."<BR>\n";
print "The translated PATH_INFO is:
".$PATH_TRANSLATED."<BR>\n";
print "The server document root directory is:
".$DOCUMENT_ROOT."<BR>\n";
print "The script name is:
".$SCRIPT_NAME."<BR>\n";
print "The query string is (FORM GET):
".$QUERY_STRING."<BR>\n";
print "The hostname making the request is:
".$REMOTE_HOST."<BR>\n";
print "The IP address of the remote host is:
".$REMOTE_ADDR."<BR>\n";
print "The authentication method is:
".$AUTH_TYPE."<BR>\n";
print "The authenticated user is:
".$REMOTE_USER."<BR>\n";
print "The remote user is (RFC 931):
".$REMOTE_IDENT."<BR>\n";
print "The content type of the data is (POST, PUT):
".$CONTENT_TYPE."<BR>\n";
print "The length of the content is:
".$CONTENT_LENGTH."<BR>\n";
print "The MIME types that the client will accept are:
".$HTTP_ACCEPT."<BR>\n";
print "The browser of the client is:
".$HTTP_USER_AGENT."<BR>\n";
print "The URL of the referer is:
".$HTTP_REFERER."<BR>\n";
print "<HR></PRE>\n";
print "</BODY></HTML>\n";
?>
----- Original Message -----
From: "cesar rodezno" <myfirstphp@yahoo.com>
To: "php lista" <lista@phpes.com>
Sent: Wednesday, March 26, 2003 11:43 AM
Subject: [PHP-ES] Nombre del host remoto
> Como puedo conocer el nombre de la maquina que esta ejecutando una
consulta, si no se puede el nombre, la direccion ip u otro que me permita
identificar la maquina que ejecuta la consulta.
>
>
> ---------------------------------
> Do You Yahoo!?
> Todo lo que quieres saber de Estados Unidos, América Latina y el resto del
Mundo.
> Visíta Yahoo! Noticias.
>