showImage.php 561 B

1234567891011121314151617
  1. <?php
  2. header("content-type:image/png");
  3. $root = $_SERVER['DOCUMENT_ROOT'];
  4. include($root . "/util/session.php");//checks that the user is logged in
  5. //include($root . "/util/privilege_check.php");
  6. $img=mysqli_real_escape_string($db,$_GET['username']);
  7. //if($_SESSION['user_type'] = "admin" || $_SESSION['username'] == $username){
  8. $sql="select * from user_info where login='$img'";
  9. $result=mysqli_query($db,$sql);
  10. if($row=mysqli_fetch_array($result)){
  11. $image_name=$row['login'] . ".png";
  12. $image_content=$row['picture'];
  13. echo $image;
  14. }
  15. // }
  16. ?>