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:

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

Whats wrong with my query?
I am trying to get this query to show the appropriate ticked vehicle roof height, unless no boxs are

disable all input buttons
Hello Friends,

suppose i do have a file ( file.php ) has a submit button

Code: [Sele

Displaying Site Logo/Icon on a Title tag
really need some help out here. I want to insert a Logo/Icon just like the one close to the "PH

help me fix these syntax errors...
I keep getting multiple syntax errors on this script like this one:

Parse error: syntax error

Memory Allocation
Hi folks,
see this ex:

int v=5;
v=v+10;

then what will do the compiler before th

How can i steam a video on my PHP site? (non YouTube)
Basically I have a PHP site and don't want to give page rank to YouTube. I just want to stream a bas

Error In Syntax
I got this error:

Code: Parse error: syntax error, unexpected '>' in /home/bucket/publ

Price in PR
Dear Experts,
Why we have to enter the price in the PR, and why there is no free goods indicato

Problem with Subscreen
Dear Experts ,
I am facing a problem with the subscreens. My senario is as follows :

selection tool on raster image
Hi!
I have to implement in my app a selection tool which lets users to select region of any shape

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