how to get IP address?


Posted on 16th Feb 2014 07:03 pm by admin

hey guys,

i have this code which is supposed to get me the IP address of my site visitors:

Did you know?Explore Trending and Topic pages for more stories like this.
Code: <?php if ($_SERVER['HTTP_X_FORWARD_FOR']) {
$ip = $_SERVER['HTTP_X_FORWARD_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
?>
but all i get back when i test it is:
Quote::1

how come the IP isnt showing, and what does "::1" mean?

thanks guys
No comments posted yet

Your Answer:

Login to answer
140 Like 49 Dislike
Previous forums Next forums
Other forums

Creating a db with a query
Hello everyone.
I'm having troubles creating a db with a query.
I'm reading a book called PHP

What are the two different files you download to update kernel?
What are the two different files you download to update kernel?

php - xml what is the best way to do this.
IN essence I want to have a script calling the info from the database.. I have no problem thus far,

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

md5 is it unique
I know this is most likely one of many simple questions that can be found semi easily. But I'm press

Include ("Absolute Path") of a file?
I'm not sure what I'm doing wrong. I am writing my php code in the same directory of the file that

VAT
how should I deal with VAT?

if I have a product that costs £5.00 and VAT @ 17.5% (£0.87

Problem in String replace program's output
Hi all,
I was trying to make a program which accepts a string and replaces it with another stri

Interpret Order
Hello all,

I'm wondering if I have this:

Code: $switch = array(
'one' =>

reading partial code from external site
Hi,

I am trying to write a script for my website to get an article from an external website.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash