| 123456789101112131415161718 |
- <?php
- $test = Test::get($id);
- if(!$test) throw new Exception("Test not found.");
- $directory = $test->getDirectory();
- $path = $directory . "/" . $name . ".jpg";
- if(file_exists($path)) {
- header("Content-Type: image/jpeg");
- readfile($path);
- }
- else {
- header("Content-Type: image/png");
- readfile("public/img/blank.png");
- }
- ?>
|