czesc,

nie mam pojecia gdzie jest blad, moze mi pomozecie?
otoz gdy wywoluje taki kod:

  1.  
  2. $name = $_GET['application'];
  3.  
  4. $text = rand(10000,99999);
  5. $_SESSION['application'][$name] = $text;
  6.  
  7. $height = 25;
  8. $width = 65;
  9. $image_p = imagecreate($width, $height);
  10. $black = imagecolorallocate($image_p, 0, 0, 0);
  11. $white = imagecolorallocate($image_p, 255, 255, 255);
  12. $font_size = 14;
  13.  
  14. imagestring($image_p, $font_size, 5, 5, $text, $white);
  15. imagejpeg($image_p, null, 80);


z adresu
  1. http://localhost/image.php?application=first
wszystko jest OK, gdy zmienie ten kod na:

  1. if (isset($_GET['application']) && !empty($_GET['application'])) {
  2. if (isset($_GET['image']) && $_GET['image'] == 'get'){
  3. $name = $_GET['application'];
  4.  
  5. $text = rand(10000,99999);
  6. $_SESSION['application'][$name] = $text;
  7.  
  8. $height = 25;
  9. $width = 65;
  10. $image_p = imagecreate($width, $height);
  11. $black = imagecolorallocate($image_p, 0, 0, 0);
  12. $white = imagecolorallocate($image_p, 255, 255, 255);
  13. $font_size = 14;
  14. imagestring($image_p, $font_size, 5, 5, $text, $white);
  15.  
  16. imagejpeg($image_p, null, 80);
  17. }
  18. }

wtedy do przegladarki zwracany jest format RAW obrazka, wiec dodaje przed linia header

  1. header('Content-type: image/jpeg');
  2. imagejpeg($image_p, null, 80);


i dostaje wtedy informacje ze obrazek zawiera bledy. Gdy go skopiuje na dysk to otwiera sie (irfanView) bez zadnego problemu. Dodam tylko ze probowalem ob_start() ale tez nie dalo to zadnego rezultatu.

gdzie mam blad Panowie?