1 <?php 2 if (!isset($_SERVER['PHP_AUTH_USER'])) { 3 header('WWW-Authenticate: Basic realm="WebKit AppCache Test Realm"'); 4 header('HTTP/1.0 401 Unauthorized'); 5 echo 'Authentication canceled'; 6 exit; 7 } else { 8 echo "OK\n"; 9 } 10 ?> 11