Here is the Magento function to get the client IP address:
echo Mage::helper('core/http')->getRemoteAddr();
getRemoteAddr()also accepts a boolean parameter. When false(by default), it will return the IP address as a string in common decimal decimal notation (for example, 192.168.0.1). When trueit returns the IP in decimal notation - a 32-bit integer. See IPv4 Address Representations for an understanding of the formats.
source
share