我正在努力使内容仅适用于我的 IP 地址和其他人。我试过了:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
if ($ip = "FirstIp" && $ip="SecondIp") {
echo "Protect Content";
} else {
echo "You do not have permission to look at this. Your IP has been recorded. $ip";
$fileofips="list.txt";
$ip = "$_SERVER[REMOTE_ADDR]";
$file=fopen($fileofips, 'a');
fwrite($f, $_SERVER[REMOTE_ADDR]);
fclose($f);
}
?>
它甚至不会捕获入侵的 IP。请调整代码;P