唯一标识一台电脑 [英] Uniquely identify one computer

查看:79
本文介绍了唯一标识一台电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一所大学工作,并且正在实施一个PHP Web应用程序,当它从一台特定的计算机访问时,需要有不同的行为。我遇到的问题是,从网络服务器,使用 $ _ SERVER ['REMOTE_ADDR'] gethostbyaddr(),我只能识别计算机将要去的路由器通过,而不是一个特定的计算机名。

有没有反正我可以设置一台特定的计算机,以识别自己的服务器,所以服务器知道什么时候从web应用程序访问那台机器?计算机在kiosk模式下运行firefox,所以插件或greasemonkey脚本是允许的...

解决方案

您可以设置一个cookie。这将被客户记住,并作为每个请求的一部分传送到服务器。更多信息在这里: http://www.w3schools.com/PHP/php_cookies.asp

I work for a university, and i'm implementing a PHP web app that needs to have different behavior when it is visited from one certain computer. The problem i am running into is that from the webserver, using $_SERVER['REMOTE_ADDR'] and gethostbyaddr(), i can only identify the router that a computer is going through, and not a specific computername.

Is there anyway i can set that one specific computer to identify itself to the server so the server knows when the webapp is being accessed from that machine? The computer is running firefox in kiosk mode, so addons or greasemonkey scripts are allowed...

解决方案

You can set a cookie. This will be remembered by the client and transmitted to the server as part of every request. More information here: http://www.w3schools.com/PHP/php_cookies.asp

这篇关于唯一标识一台电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆