To jest kompletny eksperyment .... jakos musialem wygenerowac te cholerne miniaturki, wiec cos takiego mam;

img.php

  1. <?php
  2. if(!isset($_GET['id']))
  3. {
  4.  header("Location: index.php");
  5. }
  6. else
  7. {
  8. require 'config.php';
  9. $zapytanie = 'select * from pixarcell_galeria where id = "'.$_GET['id'].'"';
  10. $wykonaj = mysql_query($zapytanie);
  11. while($row = mysql_fetch_assoc($wykonaj))
  12. {
  13.  $ImgSize = getimagesize("./upload/prace/".$row['url']);
  14.  if($ImgSize['mime']=='image/jpeg')
  15.  {
  16.  header('Content-type: image/jpeg');
  17.  $filename = "./upload/prace/".$row['url'];
  18. // Set a maximum height and width
  19. $width = 150;
  20. $height = 100;
  21. // Get new dimensions
  22. list($width_orig, $height_orig, $type) = getimagesize($filename);
  23.  
  24. if ($width && ($width_orig < $height_orig)) {
  25. $width = ($height / $height_orig) * $width_orig;
  26. } else {
  27. $height = ($width / $width_orig) * $height_orig;
  28. }
  29.  
  30. $image_p = imagecreatetruecolor($width, $height);
  31. $image = imagecreatefromjpeg($filename);
  32. imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
  33. // Output
  34. imagejpeg($image_p, null, 100);
  35.  }
  36. }
  37. }
  38. ?>


a blad polega na tym ze gdt wywolam img.php?id=2 powinno wyswietlic miniaturke z upload\prace\tlb244v6280ralsdxhavim5t8865jzp0mirror2.jpg, a pojawia sie tylko to:

Kod
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\WebServ\httpd-users\pixarcell\config.php:14) in C:\Program Files\WebServ\httpd-users\pixarcell\img.php on line 16


wstawienie ob_start(); na poczatku daje tylko taki wynik:
Kod
http://localhost/~pixarcell/img.php?id=2
... config.php wyglada tak:

  1. <?php
  2. $db['baza'] = 'np';
  3. $db['uzytkownik'] = 'root';  
  4. $db['host'] = 'localhost';  
  5. $db['haslo'] = '';
  6. $db['prefix'] = 'pixarcell_';
  7. $config['url'] = 'http:/localhost/~pixarcell/';
  8. $polacz = mysql_connect ($db['host'], $db['uzytkownik'], $db['haslo'])
  9. or DIE (mysql_error());
  10. mysql_select_db($db['baza']);
  11. ?>


mam nadzieje, ze ktos mnie zrozumie i naprowadzi na jakis wlasciwy trop...


pozdrawiam
master


edit:

troche glupia sprawa.... przenioslem "twardo" zawartosci config.php do pliku img.php i wszystko dziala :| ale to takie troche nieporaczne ... ehhh , sory za klopot...