Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]captcha brak znaków
lokotheboy
post 25.02.2012, 02:21:18
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 3.10.2011

Ostrzeżenie: (10%)
X----


Witam.
Nie wyświetlają się na stronie znaki captcha.
czcionki są oczywiście we wskazanym miejscu.

plik captcha.php
  1. <?php
  2. /* config */
  3.  
  4. $imgPatch = "images-captcha/";
  5. $fntPatch = "fonts/";
  6.  
  7. $images = preg_grep("/.+\..+/si", scandir($imgPatch));
  8. $images = $images[array_rand($images)];
  9.  
  10. $fonts = preg_grep("/.+\..+/si", scandir($fntPatch));
  11. $fonts = $fntPatch . $fonts[array_rand($fonts)];
  12.  
  13. /* script */
  14.  
  15. $i = imagecreatefromjpeg($imgPatch . $images);
  16. imagettftext($i, 25, rand(-7, 7), rand(1, 20), ceil(next(getimagesize($imgPatch . $images))/2)+10, imagecolorallocatealpha($i, 255, 255, 255, 60), $fonts, $_SESSION["captcha"]);
  17.  
  18. header('Content-Type: image/jpeg');
  19. imagejpeg($i);
  20. imagedestroy($i);
  21. ?>
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 01:08