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
这篇关于唯一标识一台计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:唯一标识一台计算机


- PHP foreach() 与数组中的数组? 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01