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

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

Binding 2 UDP sockets on same port, connected to different destinations, 1 receives
Hello,
My application wants to send/recv data to 2 different UDP ports on a remote computer, us

ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al

Having problemswith multithreading and prime numbers
I have an assignment when I'm suppose to do the following:

Write a multithreaded Java, Pt

Log $_POST
How would i log submits on a form, by everyone? I want to then echo the number of submissions.

Calling strings from other php class
I have test1.php{
$string1;
$string2;
....
... //10 strings in this class <

Secure FTP
Hi experts,
There is no SFTP action in MII workbench.
This means it needs developing custo

Multi Dimensional Array Append
Hi Guys

I have a function that returns a multidimentional array eg

$result = functio

Problem with PHP/mySQL login code
Hello,

There is an error in my login script and I can't figure out what it is...
I believe

SESSION question
I am building an application , a directory for auctions.
For SEO i made a script which copies a p

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