Witam.
Mam pytanie posrednio dotyczace sprawy php. Mam skrypt:
  1. <?php 
  2.  
  3.  
  4. $fontDir  = './fonts/'; // katalog z czcionkami 
  5. $fontFiles = array('verdana.ttf', 'impact.ttf', 'comic.ttf', 'arial.ttf'); // nazwy używanych plików czcionek 
  6. $imgType  = 'png'; // format wyświetlanej grafiki (png, gif, jpeg) 
  7. $length = 6; // długość losowego ciągu 
  8.  
  9. $backColor = '#ffffff'; // kolor tła grafiki 
  10. $fontColor = '#2a2a2a'; // kolor czcionki 
  11. $dotsColor = '#c0c0c0'; // kolor plam ;-) 
  12.  
  13. $token = substr(md5(uniqid(time())), 0 - $length); 
  14.  
  15. for($i = 0; $i < strlen($token); $i++) 
  16. { 
  17.  if(($token{$i} >= 'a' and $token{$i} <= 'z') and (rand(0, 10) > 5)) 
  18.  { 
  19. $token{$i} = strtoupper($token{$i}); 
  20.  } 
  21. } 
  22.  
  23. $_SESSION['token'] = $token; 
  24.  
  25. function make_color($img, $color) 
  26. { 
  27.  if(is_resource($img) and preg_match('/^#[a-f0-9]{6}$/i', $color)) 
  28.  { 
  29. $color = substr($color, 1); 
  30.  
  31. $rgb = array(); 
  32.  
  33. for($i = 0; $i < 6; $i += 2) 
  34. { 
  35.  $rgb[] = (int)hexdec($color{$i}.$color{$i + 1}); 
  36. } 
  37.  
  38. return imagecolorallocate($img, $rgb[0], $rgb[1], $rgb[2]); 
  39.  } 
  40.  else 
  41.  { 
  42. return 0; 
  43.  } 
  44. } 
  45.  
  46. header('Content-type: image/'.$imgType); 
  47.  
  48. $width = strlen($token) * 15 + 10; 
  49. $height = 25; 
  50.  
  51. $img = imagecreate($width, $height); 
  52.  
  53. $back = make_color($img, $backColor); 
  54. $font = make_color($img, $fontColor); 
  55. $dots = make_color($img, $dotsColor); 
  56.  
  57. $pts = array(); 
  58.  
  59. for($i = 0; $i < round($width / 1.5); $i++) 
  60. { 
  61.  $x = rand(0, $width); 
  62.  $y = rand(0, $height); 
  63.  
  64.  if(!in_array($x.'_'.$y, $pts)) 
  65.  { 
  66. imageellipse($img, $x, $y, rand(2, 7), rand(3, 6), $dots); 
  67. $pts[] = $x.'_'.$y; 
  68.  } 
  69.  else 
  70.  { 
  71. $i--; 
  72.  } 
  73. } 
  74.  
  75. for($i = 0; $i < strlen($token); $i++) 
  76. { 
  77.  imagettftext($img, rand(14, 16), rand(-10, 10), rand(3, 5) + $i * 15, 20 + rand(-3, 3), $font, $fontDir.'/'.$fontFiles[rand(0, count($fontFiles) - 1)], $token{$i}); 
  78. } 
  79.  
  80. switch($imgType) 
  81. { 
  82.  case 'jpeg': 
  83. imagejpeg($img); 
  84. break; 
  85.  case 'gif': 
  86. imagegif($img); 
  87. break; 
  88.  default: 
  89. imagepng($img); 
  90. break; 
  91. } 
  92.  
  93. imagedestroy($img); 
  94.  
  95. ?>


Wywolanie:
www.oxmedia.pl/yambo/token.php
dziala bez zarzutow, natomiast
www.yambo.pl (te same konto, domena yambo.pl dopisana do katalogu www.oxmedia.pl/yambo)
ma problemy..
Ktoś ma jakieś sugestie ?


Nie mogłem już edytować....

Gapa jestem po prostu.
Domena przypisana do katalogu potrzebuje pliku /tmp/ do zapisu..... ehh.....

pozdrawiam.