0
我寫了這個代碼錯誤:未定義指數:HTTP_X_FORWARDED_FOR
$ips = preg_split("/,/", $_SERVER["HTTP_X_FORWARDED_FOR"]);
$ip = $ips[0];
if ($key === $ip && $val === env('SERVER_ADDR')) {
$addr = env($ip);
if ($addr !== null) {
$val = $addr;
}
}
但我得到以下錯誤:
<b>Notice</b>: Undefined index: HTTP_X_FORWARDED_FOR