OLD | NEW |
(Empty) | |
| 1 <?php |
| 2 if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_REQUEST['uid']) || $_REQUEST['
uid'] != $_SERVER['PHP_AUTH_USER']) { |
| 3 header('WWW-Authenticate: Basic realm="blink test realm"'); |
| 4 header('HTTP/1.0 401 Unauthorized'); |
| 5 echo 'Authentication cancelled.'; |
| 6 } else { |
| 7 header("Access-Control-Allow-Origin: *"); |
| 8 $name = 'abe.png'; |
| 9 $fp = fopen($name, 'rb'); |
| 10 header("Content-Type: image/png"); |
| 11 header("Content-Length: " . filesize($name)); |
| 12 header('HTTP/1.0 200 OK'); |
| 13 fpassthru($fp); |
| 14 } |
| 15 ?> |
OLD | NEW |