On Sun, 31 Oct 2004 14:39:17 -0800, Tim Roberts <timr@probo.com>
wrote:
[color=blue]
>"deko" <www-dot-clearpointsystems-dot-com@nospam.com> wrote:
>[color=green]
>>Follow up question:
>>
>>How do I call the RealIp function? What I have below is not working.
>>
>>function realIp()
>> {
>> $ip_array=explode(",", $visip);
>> return trim($ip_array[0]);
>> }
>>if (isset($_SERVER))
>> {
>> if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
>> {
>> $visip = $_SERVER["HTTP_X_FORWARDED_FOR"];
>> $visip = realIp();
>> }[/color]
>
>
>Don't rely on globals.
>
>function realIp($unrealIp)
>{
> $ip_array = explode(",", $unrealIp);
> return trim($ip_array[0]);
>}
>...
> {
> $visip = realIp($_SERVER['HTTP_X_FORWARDED_FOR"]);
> }
>
>What makes you think the first IP in the list is any more "real" than any
>of the others? Do you hope to use this for some kind of validation? If
>so, the numbers are quite unreliable.[/color]
Exactly. If there's more than one IP, you'd have to validate for each
one or all of them at once.
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one!
http://signup.databasix.com
================================================== =========================