- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我的站点严重依赖于 $_SERVER['SERVER_ADDR']
。我可以信任检索到的数据吗?有没有可能找到空字符串?
最佳答案
我引用了一些php引用
这似乎取决于托管 PHP 的服务器(尤其是 apache , IIS ...)
http://php.net/manual/en/reserved.variables.server.php
On Windows IIS 7 you must use $_SERVER['LOCAL_ADDR'] rather than $_SERVER['SERVER_ADDR'] to get the server's IP address.
还有一个。
Windows running IIS v6 does not include $_SERVER['SERVER_ADDR']
If you need to get the IP addresse, use this instead:
<?php $ipAddress =
gethostbyname($_SERVER['SERVER_NAME']);
?>
关于php - $_SERVER ['SERVER_ADDR' ] 可以安全依赖吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5705082/
我的配置页面上有一个 undefined index ,它显示: Notice: Undefined index: SERVER_ADDR in inc/config .inc.php on line
我的站点严重依赖于 $_SERVER['SERVER_ADDR']。我可以信任检索到的数据吗?有没有可能找到空字符串? 最佳答案 我引用了一些php引用 这似乎取决于托管 PHP 的服务器(尤其是 a
$_SERVER['SERVER_ADDR'] 是否始终设置? 我应该检查 isset() 还是没有必要? 我需要获取站点的 IP,以便确定它是否为 127.0.0.1/localhost 最佳答案
之间的任何真正区别 $_SERVER['REMOTE_ADDR'] $_SERVER['SERVER_ADDR'] 我正在跟踪页面的访问者,我一直使用 REMOTE_ADDR,但最近我看到了一个收集这
如果 SERVER_ADDR 和 SERVER_NAME 变量不匹配,我需要重定向用户。 我的 httpd.conf 文件中有以下规则: RewriteEngine on RewriteCond %{
我们有多个负载平衡的网络服务器机器运行相同的 PHP 网络应用程序 (LAMP),我想在每台服务器上运行略有不同的代码(用于测试目的)。我希望使用 $_SERVER['SERVER_ADDR'] su
如何获取运行node.js服务器的机器的IP地址?我检查了 process.env。但这似乎不包括这个变量。 最佳答案 您的 net.createServer() 服务器有一个 .address()属
我是一名优秀的程序员,十分优秀!