Reputation: 394
i am developing a website which needs a user to be logged in his comuter using administrator account to be able to login in this website running on local area network. I want to know if its possible using codeigniter (php framework).
Upvotes: 1
Views: 85
Reputation: 2702
This program only returns the client machine name in localhost only
echo gethostbyaddr($_SERVER['REMOTE_ADDR']);
If it is run from an online server, then computer name is not shown and some other information is being shown. So is there anyway to get the computer name in php when the program runs from online server.
function GetComputerName()
{
try
{
var network = new ActiveXObject('WScript.Network');
// Show a pop up if it works
alert(network.computerName);
}
catch (e) { }
}
This is javascript that will work in IE, sometimes. That's the best you can do. You can then push that value in to a control and then when the user posts to the server, you can read it in PHP. PHP can't do what you want because it runs on the server, not the client, so it can't look up client data.
Upvotes: 1