<?php$strAuthUser= $_SERVER['PHP_AUTH_USER'];$strAuthPass= $_SERVER['PHP_AUTH_PW'];if (! ($strAuthUser == "<span style="color: #ff0000;">用户名</span>" && $strAuthPass == "密码")) {header('WWW-Authenticate: Basic realm="Autn"');header('HTTP/1.0 401 Unauthorized');echo "用户验证";exit;} else {echo "验证通过";}?>