Linked Questions
164 questions linked to/from How to get the client IP address in PHP
240
votes
4
answers
1.0m
views
Get the client IP address using PHP [duplicate]
I want to get the client IP address who uses my website. I am using the PHP $_SERVER superglobal:
$_SERVER['REMOTE_ADDR'];
But I see it can not give the correct IP address using this. I get my IP ...
117
votes
9
answers
349k
views
How to get Real IP from Visitor? [duplicate]
I'm using this PHP code to get a visitor's IP address:
<?php echo $_SERVER['REMOTE_ADDR']; ?>
But, I can't get the real IP address from visitors when they are using a proxy. Is there any way to ...
31
votes
10
answers
13k
views
How can I get the client's IP address in a PHP webservice? [duplicate]
I have developed a PHP webservice. I would like to log all incoming connections of the WS clients, which are consuming this web service. How can I obtain the client's IP address? The value of $_SERVER[...
-2
votes
2
answers
16k
views
How to get real IP of user using PHP? [duplicate]
I've been trying to get real IP address of the user, and not a proxy address. For that I've done this:
$ip1 = $_SERVER['REMOTE_ADDR'];
$ip2 = $_SERVER['HTTP_X_FORWARDED_FOR'];
$ip3 = $_SERVER['...
38
votes
0
answers
43k
views
How do I find a user's IP address with PHP? [duplicate]
I would like to find a user's IP address when he/she enters my page. How do I programmatically do that?
1
vote
2
answers
6k
views
How to get my site visitor's IP address in php [duplicate]
using $_SERVER['HTTP_CLIENT_IP'] is not providing the client's ip address.
What could be the reason?
0
votes
2
answers
7k
views
How can I get the client IP using PHP? [duplicate]
I have a webpage with PHP and im trying to get the client IP, but what I get is the server GATEWAY ip address (192.168.0.1).
This is what I have at the office:
ISP ---> ISP router ---> My router(192....
-2
votes
2
answers
5k
views
How do I add client IP Address to Database while registering. [duplicate]
As the title says it all, how do I add their IP addresses to my SQL database while they are registering. I'm hosting a game server to track which ID is on which IP.
<?php
if($...
-1
votes
2
answers
14k
views
Get the ip address of client in php [duplicate]
I am using the following function for getting the ip address of client.
function get_client_ip() {
$ipaddress = '';
if (isset($_SERVER['HTTP_CLIENT_IP']))
$ipaddress = $_SERVER['...
0
votes
1
answer
4k
views
using $_SERVER['REMOTE_ADDR'] , $_SERVER['HTTP_CLIENT_IP'] & $_SERVER['HTTP_X_FORWARDED_FOR'] [duplicate]
i'm coding web application and i wanna secure my customers accounts so i'll get their IPs and store them in the database
is that enough to use
$_SERVER['REMOTE_ADDR']
OR
It's better to use these
$...
1
vote
1
answer
2k
views
$_SERVER['SERVER_ADDR'] is Undefined on php over plesk [duplicate]
I am running a PHP script over PLESK that runs PHP codes via fastcgi to php feature.
everything works well but when I want to get USER IP address via this code
$_SERVER['SERVER_ADDR']
I encounter ...
-1
votes
1
answer
2k
views
how to get ip address of client machine in mysql database [duplicate]
I have a MySQL query that inserts the content of a form into my database.
Along side inserting these values, I also want to discover and insert the users IP address.
0
votes
2
answers
2k
views
get ip and mac address of client using PHP or javascript [duplicate]
I was trying to get IP and MAC address of client using PHP but I am unable to get that. I tried below code but it gives wrong MAC address -
ob_start(); // Turn on output buffering
system(‘ipconfig /...
-1
votes
1
answer
2k
views
Php $_SERVER['REMOTE_ADDR'] gives different ip everytime [duplicate]
I am using Php superglobal $_SERVER['REMOTE_ADDR'] to get the client ip . But it always gives me different ip address and also ip provided by $_SERVER['REMOTE_ADDR'] is not correct my ip on local ...
-3
votes
1
answer
706
views
How to get the local ip address using php? [duplicate]
I 'm creating a web app in which i need to save the sessions in the database including the Ip address of the user and the date and time of the session , for that i want to know how to do that ,knowing ...