Randal... try this one...

function getClientIp()
{
        // This function get the IP of an user, even when he's behind a simple 
proxy
        // List of possible ip sources, in order of priority
        $ip_sources = array(
        "HTTP_X_FORWARDED_FOR",
        "HTTP_X_FORWARDED",
        "HTTP_FORWARDED_FOR",
        "HTTP_FORWARDED",
        "HTTP_X_COMING_FROM",
        "HTTP_COMING_FROM",
        "REMOTE_ADDR",
        );

        foreach ($ip_sources as $ip_source) {
                if (isset($_SERVER[$ip_source])) {
                        $proxy_ip = $_SERVER[$ip_source];
                        break;
                }
        }

        // If the ip is still not found, try the getenv() function without
        // error reporting. This will automatically provide a FALSE result
        // on failure
        $proxy_ip = (isset($proxy_ip)) ? $proxy_ip : @getenv("REMOTE_ADDR");

        // Return the IP found
        return $proxy_ip;
}


This can help you to retrieve the right requester ip.
Later give me some feedback if it worked, please.


Regards,


On Thu, Feb 28, 2008 at 10:08 AM, Randal Rust <[EMAIL PROTECTED]> wrote:
> > just try with $_SERVER['REMOTE_ADDR'] it gives ip of client machine
>
>  yeah, that's what i meant. however, i was trying to get around using
>  the full IP.
>
>
>
>  --
>  Randal Rust
>  R.Squared Communications
>  www.r2communications.com
>  _______________________________________________
>  New York PHP Community Talk Mailing List
>  http://lists.nyphp.org/mailman/listinfo/talk
>
>  NYPHPCon 2006 Presentations Online
>  http://www.nyphpcon.com
>
>  Show Your Participation in New York PHP
>  http://www.nyphp.org/show_participation.php
>



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
São Carlos - SP/Brazil
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to