Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MySql][jpg] MIME type
hettmix
post
Post #1





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 10.03.2012

Ostrzeżenie: (0%)
-----


Witam.

Mam taki kodzik, którego celem jest wyświetlenie obrazka pobieranego z bazy:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. </head>
  4. <img width=160 height=70 border=0 src="../modules/mod_edit_user/users_podpis.php" />
  5. </body>
  6. </html>

Plik users_podpis.php
  1. <?php
  2. header('Content-Type: image/jpeg; charset=UTF-8');
  3.  
  4. require "/volume1/web/Joomla_1.5/connection/connection.php";
  5. include "/volume1/web/Joomla_1.5/joomla-auth-porzadkowe.php";
  6. include "/volume1/web/Joomla_1.5/joomla-config-porzadkowe.php";
  7.  
  8. connection();
  9.  
  10. $interface="admin";
  11. $uzytkownik=JFactory::getUser()->username;
  12.  
  13.  
  14. $res=mysql_query("SELECT podpis from jos_users where username='".$uzytkownik."';") or die('Błąd zapytania select');
  15. $res=mysql_fetch_row($res);
  16. $jpeg=$res[0];
  17.  
  18. if (strlen($jpeg)==0) {
  19. $jpeg = file_get_contents("/volume1/web/Joomla_1.5/modules/mod_edit_user/images/brakpodpisu.jpg");
  20. }
  21.  
  22. header("Content-Disposition: inline; filename=podpis");
  23. print $jpeg;
  24.  
  25. ?>


Konsola JavaScript wyrzuca poniższy błąd:
Resource interpreted as Image but transferred with MIME type text/html: "modules/mod_edit_user/users_podpis.php".
Jak rozgryźć ten problem, by wyświetlić plik *.jpg ?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 27.09.2025 - 12:38