shajjad
shajjad

Reputation: 21

How to get client computer name using php from remote server

I have already used following php script in remote server application but got null value ::

exec('wmic COMPUTERSYSTEM Get UserName', $user);
$pc_user = (explode('\\',$user[1]));
$download_location = "c:/users/$pc_user[1]/downloads/";

Result :: Array()

But in local pc I got the pc user name properly.

Upvotes: 0

Views: 4624

Answers (1)

Meera Tank
Meera Tank

Reputation: 719

You can get following thorough PHP scripts

$_SERVER['REMOTE_ADDR']; // Returns the IP address of client
$_SERVER['RREMOTE_HOST']; // Returns the Host name of client
$_SERVER['REMOTE_PORT']; // Returns the port being used to communicate

Upvotes: 1

Related Questions