xionhack Posted May 14, 2010 Share Posted May 14, 2010 Hello. Im making a help desk application that the people in my company will be able to access from their computers to say if they have any computer related problem. The thing is, it wont be possible for me to make a login and password for every user, i cannot assign the problem to the ip or to the hostname because they are not static (by assign I mean to say who the problem belongs to). I want to see if there is a way for me to assign it to the computer itself, or make a way to identify which computer is it through php, i know php is server side but how can I do what im trying to do? Please let me know if Im not being clear Quote Link to comment Share on other sites More sharing options...
MatthewJ Posted May 14, 2010 Share Posted May 14, 2010 How is the host name not static? People rename their computers all day? Quote Link to comment Share on other sites More sharing options...
MatthewJ Posted May 14, 2010 Share Posted May 14, 2010 This line of code will return the host name of the computer, which should be unique and static to every computer $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); Quote Link to comment Share on other sites More sharing options...
xionhack Posted May 14, 2010 Author Share Posted May 14, 2010 The thing is that what if for some reason the ip changes. Ips are not static Quote Link to comment Share on other sites More sharing options...
jskywalker Posted May 14, 2010 Share Posted May 14, 2010 while ip-addresses should not change very often (maybe only if computer stays off for more than 14 days or more, depending on the DHCP configuration) you could also use the MAC-address http://codingresource.blogspot.com/2010/02/get-client-mac-address-ip-address-using.html This address is unique for every network-card. Quote Link to comment Share on other sites More sharing options...
ignace Posted May 14, 2010 Share Posted May 14, 2010 Matthew you are interpreting this wrong: Im making a help desk application that the people in my company will be able to access from their computers to say if they have any computer related problem. As you have access to each computer you can set a static IP for each computer or set the DHCP server to lease an IP longer 1-week, 1-month, ... Get the IP of the computer using: $_SERVER['REMOTE_ADDR'] Quote Link to comment Share on other sites More sharing options...
ignace Posted May 14, 2010 Share Posted May 14, 2010 you could also use the MAC-address http://codingresource.blogspot.com/2010/02/get-client-mac-address-ip-address-using.html the client still needs to enable ActiveX components on his browser. Which means JS which in my case is turned off. Quote Link to comment Share on other sites More sharing options...
xionhack Posted May 14, 2010 Author Share Posted May 14, 2010 There are more than 1000 computers and most of the servers lease the ip for about 8 days Quote Link to comment Share on other sites More sharing options...
ignace Posted May 14, 2010 Share Posted May 14, 2010 There are more than 1000 computers and most of the servers lease the ip for about 8 days How long does it average take before a computer problem is solved? Like I said you can set the DHCP server to lease the IP longer. PHP can't read out any other information and using JS to read out MAC addresses isn't the best approach either as JS can be disabled. Actually none of both methods are good in your situation, I would look into .NET as they allow communication with the Windows client with some imagination you can create something that will exactly pin-point the computer, like for example a big floor plan that visualizes every computer and lights up red when an error is reported. Quote Link to comment Share on other sites More sharing options...
jskywalker Posted May 14, 2010 Share Posted May 14, 2010 in yuor first post you said " in my company " so, you can decide about computer-names, and you can disallow users to change the name of a computer (network-policy, i.e.: http://technet.microsoft.com/en-us/library/cc771624(WS.10).aspx) if that is arranged, you should use one of the 1st options givven here: $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); Quote Link to comment Share on other sites More sharing options...
MatthewJ Posted May 14, 2010 Share Posted May 14, 2010 I know how DHCP works... what does that have anything to do with gethostbyaddr()? I haven't dug into that function much, but I would assume it is doing a name resolution with a ping... the ping of any dhcp address is going to resolve to the hostname of the system it is currently being run on... the host name does not change so whether I get handed 192.9.200.100 or 192.9.200.101, gethostbyaddr() is going to resolve to the hostname of the computer... what is in question here is not what address they have, but what physical computer had that address at the time. Not sure why that is confusing, but okay I have a small help desk app that does exactly this... so, it must be magic that it works for me then? Quote Link to comment Share on other sites More sharing options...
xionhack Posted May 17, 2010 Author Share Posted May 17, 2010 Hey Matthew, yes I think Im going with that solution, at the end even if I change the computer name because that computer was given to somebody else, I dont want them to see the problems that the previous person had. Thanks for everything Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.