You are here: Re: how to get client ip php « PHP Programming Language « IT news, forums, messages
Re: how to get client ip php

Posted by Rob on 12/20/07 09:34

On Dec 20, 6:08 am, upendra...@gmail.com wrote:
> Hello friends,
>
> I am using the function
> of how to get client IP from my website but it always
> give me the server ip not any client who send me the info..
>
> 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;
>
> }
>
> thanx in advance

Have you tried $_SERVER["REMOTE_ADDRESS"] instead?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация