ntunnel_mysql.php 中增加
function check() { if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); // echo 'Text to send if user hits Cancel button'; exit; } if(!($_SERVER['PHP_AUTH_USER'] == 'mysql' && $_SERVER['PHP_AUTH_PW'] == 'wenxue')) { exit; } }check();