wmaraci reklam
lidertakipci

PHP captcha sorunu

4 Mesajlar 771 Okunma
advertseo
wmaraci reklam

Skynlexx Skynlexx WM Aracı Kullanıcı
  • Üyelik 24.03.2018
  • Yaş/Cinsiyet 29 / E
  • Meslek Bilgisayar Mühendisi
  • Konum Isparta
  • Ad Soyad B** Ş**
  • Mesajlar 57
  • Beğeniler 22 / 9
  • Ticaret 0, (%0)
PHP-GD yüklü fakat localde çalışan hostingde çalışmıyor .s

Kodlar
session_start();


class CaptchaSecurityImages {

var $font = 'captcha_font.ttf';

function generateCode($characters) {
/* list all possible characters, similar looking characters and vowels have been removed */
$possible = 'abcdefghsytrk123456789';
$code = '';
$i = 0;
while ($i < $characters) {
$code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);
$i++;
}
return $code;
}

function CaptchaSecurityImages($width='80',$height='20',$characters='5') {
$code = $this->generateCode($characters);
/* font size will be 75% of the image height */
$font_size = $height * 0.70;
$image = @imagecreate($width, $height) or die('Yeni GD Goruntu akisi baslatilamiyor!');
/* set the colours */
$background_color = imagecolorallocate($image, 0, 0, 0);
$text_color = imagecolorallocate($image, 255, 255, 255);
$noise_color = imagecolorallocate($image, 100, 120, 180);

$textbox = imagettfbbox($font_size, 0, $this->font, $code) or die('"imagettfbbox" Fonksiyonu hatasi!');
$x = ($width - $textbox[4])/2;
$y = ($height - $textbox[5])/2;
imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code) or die('"imagettftext" Fonksiyonu hatasi!');
/* output captcha image to browser */
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
$_SESSION['guvenlik_kodu'] = $code;
session_register("guvenlik_kodu");
}

}

$width = isset($_GET['width']) ? $_GET['width'] : '100';
$height = isset($_GET['height']) ? $_GET['height'] : '20';
$characters = isset($_GET['characters']) && $_GET['characters'] > 1 ? $_GET['characters'] : '5';

$captcha = new CaptchaSecurityImages($width,$height,$characters);


$_SESSION['guvenlik_kodu'] = $code;
session_register("guvenlik_kodu");

?>
 

 

İnsan insana insan olduğu kadar insan olmalı..
wmaraci
reklam

tepeumut tepeumut umuttepe.com.tr Kullanıcı
  • Üyelik 28.12.2016
  • Yaş/Cinsiyet 24 / E
  • Meslek Öğrenci
  • Konum İstanbul Avrupa
  • Ad Soyad U** T**
  • Mesajlar 64
  • Beğeniler 1 / 20
  • Ticaret 0, (%0)
Hata olarak ne aliyorsun ?
 

 

http://umuttepe.com.tr

Skynlexx Skynlexx WM Aracı Kullanıcı
  • Üyelik 24.03.2018
  • Yaş/Cinsiyet 29 / E
  • Meslek Bilgisayar Mühendisi
  • Konum Isparta
  • Ad Soyad B** Ş**
  • Mesajlar 57
  • Beğeniler 22 / 9
  • Ticaret 0, (%0)
imagettfbbox" Fonksiyonu hatasi! Veriyor
 

 

İnsan insana insan olduğu kadar insan olmalı..

BerkayZ BerkayZ www.zelyurt.com Kullanıcı
  • Üyelik 02.07.2017
  • Yaş/Cinsiyet 29 / E
  • Meslek Öğrenci
  • Konum İstanbul Anadolu
  • Ad Soyad B** Z**
  • Mesajlar 162
  • Beğeniler 36 / 43
  • Ticaret 4, (%100)
Şunu deneyebilirsiniz : https://github.com/BerkayZ/basic-captcha
İstediğiniz gibi değiştirin.
 

 

-Z-
wmaraci
wmaraci
wmaraci
Konuyu toplam 1 kişi okuyor. (0 kullanıcı ve 1 misafir)
Site Ayarları
  • Tema Seçeneği
  • Site Sesleri
  • Bildirimler
  • Özel Mesaj Al