prabhjot
prabhjot

Reputation: 394

Check computer administrator or not using php

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

Answers (2)

Abhijit Jagtap
Abhijit Jagtap

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

DFriend
DFriend

Reputation: 8964

Yes, it is possible but user login/verification is not built-in to Codeigniter. You will have to code it yourself or use one of several third-party user admin systems that are available for CI.

This page lists several third-party solutions.

Upvotes: 2

Related Questions