-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Aug 19, 2003 at 07:04:33AM -0000, HASH  BABA wrote:
HASH>well , Problem is that , My PHP script installed  in  a webserver 
HASH>,I just want that whenever client request for that script,Script 
HASH>should return the IP address of client machine.In other word we 
HASH>can say that PHP Script should return the IP address of evey 
HASH>machine , where it runs.
        Where it runs? or IP of the person who visits your script?
        
        $ip = getenv ("REMOTE_ADDR"); // get the ip number of the user
        
        uf this dsnt work probably you have an old version of PHP
        installed. try this instead

        function getIP() 
        {
                $ip;
                
                if (getenv("HTTP_CLIENT_IP"))
                        $ip = getenv("HTTP_CLIENT_IP");
                else if(getenv("HTTP_X_FORWARDED_FOR))
                        $ip = getenv("HTTP_X_FORWARDED_FOR");
                else if(getenv("REMOTE_ADDR"))
                        $ip = getenv("REMOTE_ADDR");
                else
                        $ip = "UNKNOWN";
                return $ip;

        }

        $ip=getIP(); //will call the function to get the ip of the user

        hope it helps.
        
- -- 
all the things we keep inside,
are the things that really matter,
the face puts on its best disguise,
and all is well, until the heart betrays.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/QdM17v3NbZTFJeIRAvcPAKDZ0fU+D17FSnfQvv4h1ZYtj8jGvQCgnE+g
C/hWid/Gtd68exnpDwC9cxs=
=c1Xx
-----END PGP SIGNATURE-----

_______________________________________________
ilugd mailing list
[EMAIL PROTECTED]
http://frodo.hserus.net/mailman/listinfo/ilugd

Reply via email to