PageRenderTime 74ms CodeModel.GetById 26ms RepoModel.GetById 2ms app.codeStats 0ms

/includes/photo.php

https://bitbucket.org/mw4rf/ajpsc-annuaire
PHP | 40 lines | 12 code | 11 blank | 17 comment | 1 complexity | c57781b37d353d168f15096198c44774 MD5 | raw file
  1. <?php
  2. // Annuaire Alumnii
  3. // Base de données et annuaire d'anciens étudiants.
  4. // Copyright (C) <2006> <Guillaume Florimond>
  5. // This program is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  15. session_start();
  16. if(!isset($_GET['id']) or empty($_GET['id']))
  17. header("Location: index.php");
  18. include('config.inc.php');
  19. include('fonctions.inc.php');
  20. // Get image ID in database
  21. $id = intval($_GET['id']);
  22. // Connecting database
  23. connexion();
  24. // Loading image
  25. $r = mysql_fetch_assoc(mysql_query("SELECT photo,extension FROM photo WHERE user_id = '$id'"));
  26. // Displaying
  27. header('Content-type: image/'.$r['extension']);
  28. echo $r['photo'];
  29. ?>