Uniquely identify one computer(唯一标识一台计算机)
问题描述
我在一所大学工作,我正在实现一个 PHP 网络应用程序,当从一台特定的计算机访问它时,它需要具有不同的行为.我遇到的问题是,从网络服务器,使用 $_SERVER['REMOTE_ADDR'] 和 gethostbyaddr(),我只能识别计算机正在运行的路由器通过,而不是特定的计算机名称.
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.
无论如何我可以设置那台特定的计算机来向服务器标识自己的身份,以便服务器知道何时从该机器访问 webapp?计算机在 kiosk 模式下运行 firefox,因此允许使用插件或油脂猴脚本...
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...
推荐答案
您可以设置 cookie.这将被客户端记住并作为每个请求的一部分传输到服务器.更多信息请访问:http://www.w3schools.com/PHP/php_cookies.asp
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
这篇关于唯一标识一台计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:唯一标识一台计算机


基础教程推荐
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何替换eregi() 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01