Article View: es.comp.os.linux.programacion
Article #8765Re: obtecion de ip con php
From: Marcos Dobarro Otero
Date: Mon, 14 Oct 2002 17:59
Date: Mon, 14 Oct 2002 17:59
43 lines
1966 bytes
1966 bytes
Jose A wrote:
> Pues por ejemplo as�:
>
> --------------------cortar aqui---------------------
> <?
> $ip = getenv ("REMOTE_ADDR");
> echo "$ip\n";
> ?>
> --------------------cortar aqui---------------------
>
> o as�:
>
> --------------------cortar aqui---------------------
> <?
> $ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
> echo "$ip\n";
> ?>
> --------------------cortar aqui---------------------
>
> Para guardar los datos, te puedes crear una base de datos
> en mysql, y con una estructura tipo "hora,ip".
>
> O tambien puedes enviar un mail a una direcci�n de correos
> asi:
>
> --------------------cortar aqui---------------------
> <?
> $ip = "Esta ip ha entrado en tu servidor web: $ip\n";
> mail ("dire@dominio","subject",
$ip);
> ?>
> --------------------cortar aqui---------------------
>
Y me digo yo no es m�s facil algo como:
<?
$IP = $REMOTE_ADDR;
echo "La IP es $IP";
?>
Desde luego es mucho m�s claro. :-))
Technical Details
Message-ID:
<jl0foa.k24.ln@www.mardot.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!213.60.228.118!not-for-mailReferences:
<ao96q9$l57$1@reader2.wnet> <slrnaqg9fd.20q.MAQUI000@213.60.228.203>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,1b5c2d859e57cf8d X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2002-10-14 11:01:34 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!213.60.228.118!not-for-mail From: Marcos Dobarro Otero <mardot_esSPAM@terra.es> Newsgroups: es.comp.os.linux.programacion Subject: Re: obtecion de ip con php Date: Mon, 14 Oct 2002 19:59:15 +0200 Lines: 43 Message-ID: <jl0foa.k24.ln@www.mardot.com> References: <ao96q9$l57$1@reader2.wnet> <slrnaqg9fd.20q.MAQUI000@213.60.228.203> Reply-To: mardot_esSPAM@terra.es NNTP-Posting-Host: 213.60.228.118 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8Bit X-Trace: fu-berlin.de 1034618488 22770935 213.60.228.118 (16 [142849]) X-Orig-Path: www.mardot.com!not-for-mail User-Agent: KNode/0.7.1