I Want IP address from which the user is viewing the current page
and i m using
echo $_SERVER['REMOTE_ADDR'];
and it show me 127.0.0.1
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is a Magento function to get customer’s IP Address:
getRemoteAddr()also accepts a boolean parameter. Whenfalse(default) it will return the IP address as a string in the common dotted-decimal notation (e.g. 192.168.0.1). Whentrueit will return the IP in its decimal notation–a 32-bit integer. See IPv4 Address Representations to understand the formats.