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

Error querying database.
I get the above error when trying to insert some values to a datatable.
Here's the code :

output printing as hexadecmal... XD
Everything works except the calcem call for the totusold and totuprice. The out put shows up as hex.

Using system() and bringing back the results
I am aware that you can use system() within PHP to execute system commands, but I was wondering if t

Progress bar for webpage
Hi,
I want to implement a progress/waiting bar on my webpage - exactly the same thing that the Mi

Multiple Dropdown Selections
I have a form that let's a user insert a page with the ability to select categories. I want them to

subtract 1 from value entered in text field
Hi

How do I subtract 1 from the vaue entered into a text field?

Thanks

Sequencing or queuing parallel process
Scenario is as follows
There is one parent process say P1 and 4 child processes say A B C D

Extra fields in main body and php required.
I'm new to PHP so please be gentle. I have a little php script below that works well.
The &quo

Creating Images from images in PHP
Okay well I am trying to make a 'dynamic' calender image with PHP.

I have images like this:

distinct rows
Hi
version 10.2.0.3

I have a query output something like the following

ID

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