• 07-07-2013, 11:05:39
    #1
    Selam kolay gelsin,


    internette aradım fakat bir türlü bulamadım, hepsinde aynı hata ile karşılaşıyorum.Yani anlayacağınız captcha başıma bela oldu

    PHP Versiyon 5.3.26 bu fakat hepsinde aynı hata ile karşılaşıyorum hata;

    Kodlar:

    <?php
    session_start();
    
    /*
    * File: CaptchaSecurityImages.php
    * Author: Simon Jarvis
    * Copyright: 2006 Simon Jarvis
    * Date: 03/08/06
    * Updated: 07/02/07
    * Requirements: PHP 4/5 with GD and FreeType libraries
    * Link: http://www.white-hat-web-design.co.uk/articles/php-captcha.php
    * 
    * This program is free software; you can redistribute it and/or 
    * modify it under the terms of the GNU General Public License 
    * as published by the Free Software Foundation; either version 2 
    * of the License, or (at your option) any later version.
    * 
    * This program is distributed in the hope that it will be useful, 
    * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    * GNU General Public License for more details: 
    * http://www.gnu.org/licenses/gpl.html
    *
    */
    
    class CaptchaSecurityImages {
    
    	var $font = 'monofont.ttf';
    
    	function generateCode($characters) {
    		/* list all possible characters, similar looking characters and vowels have been removed */
    		$possible = '23456789bcdfghjkmnpqrstvwxyz';
    		$code = '';
    		$i = 0;
    		while ($i < $characters) { 
    			$code .= substr($possible, mt_rand(0, strlen($possible)-1), 1);
    			$i++;
    		}
    		return $code;
    	}
    
    	function CaptchaSecurityImages($width='120',$height='40',$characters='6') {
    		$code = $this->generateCode($characters);
    		/* font size will be 75% of the image height */
    		$font_size = $height * 0.75;
    		$image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream');
    		/* set the colours */
    		$background_color = imagecolorallocate($image, 255, 255, 255);
    		$text_color = imagecolorallocate($image, 20, 40, 100);
    		$noise_color = imagecolorallocate($image, 100, 120, 180);
    		/* generate random dots in background */
    		for( $i=0; $i<($width*$height)/3; $i++ ) {
    			imagefilledellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color);
    		}
    		/* generate random lines in background */
    		for( $i=0; $i<($width*$height)/150; $i++ ) {
    			imageline($image, mt_rand(0,$width), mt_rand(0,$height), mt_rand(0,$width), mt_rand(0,$height), $noise_color);
    		}
    		/* create textbox and add text */
    		$textbox = imagettfbbox($font_size, 0, $this->font, $code) or die('Error in imagettfbbox function');
    		$x = ($width - $textbox[4])/2;
    		$y = ($height - $textbox[5])/2;
    		imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code) or die('Error in imagettftext function');
    		/* output captcha image to browser */
    		header('Content-Type: image/jpeg');
    		imagejpeg($image);
    		imagedestroy($image);
    		$_SESSION['security_code'] = $code;
    	}
    
    }
    
    $width = isset($_GET['width']) ? $_GET['width'] : '120';
    $height = isset($_GET['height']) ? $_GET['height'] : '40';
    $characters = isset($_GET['characters']) && $_GET['characters'] > 1 ? $_GET['characters'] : '6';
    
    $captcha = new CaptchaSecurityImages($width,$height,$characters);
    
    ?>
    Fatal error: Call to undefined function imagettfbbox() in ...
    Sorunu bilen varsa veya daha önce karşılaşmıssa ne tür çözüm yolları vardır , öğrenmek istiyorum.

    Kolay gelsin.
  • 08-07-2013, 08:54:33
    #2
    Üyeliği durduruldu
    mail adresini at sana kendi yaptıgım captcha atıyım dene bi...
  • 08-07-2013, 09:21:15
    #3
    GD kütüphanesi yüklü olmadığı için o hatayı vermiş sanırım. Bir php dosyasına <?php phpinfo(); ?> yazıp sayfa içinde GD diye arama yapın öyle birşey var mı diye...
  • 08-07-2013, 13:26:22
    #4
    Cyclone adlı üyeden alıntı: mesajı görüntüle
    mail adresini at sana kendi yaptıgım captcha atıyım dene bi...
    Attım

    cenkkoroglu adlı üyeden alıntı: mesajı görüntüle
    GD kütüphanesi yüklü olmadığı için o hatayı vermiş sanırım. Bir php dosyasına <?php phpinfo(); ?> yazıp sayfa içinde GD diye arama yapın öyle birşey var mı diye...
    GD Support enabled

    hocam gd desteği var.
  • 08-07-2013, 18:32:56
    #5
    MysqLv1 adlı üyeden alıntı: mesajı görüntüle
    Hata veren fonksiyonun kodlarını paylaşırsanız daha rahat yardım bulabilirsiniz. Böyle anlamak mümkün değil
    Kodları paylaştım , eski php sürümden hiçbir hata vermiyordu fakat yeni php sürümüne geçtikten sonra bu hatayı almaya başladım.
  • 08-07-2013, 18:48:57
    #6
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Öncelikle;

    imagettfbbox() php ile tanımlı bir fonsion değil GD kütüphanesinin fonsionu. Fonsionu paylaşırmısın demiş birisi başka tanımlı bir fonsion sanmış sanıyorum belki de C kodlarını istiyordur gd kütüphanesinin

    Sorununuz php versionundan değil, ben size direk doktor house edasoyla anlatayım;

    Php güncellemek için easyapache kullandınız versionu yükseltip next next dediniz ve kurdunuz kurulumu yaparken GD kütüphanesini seçmediniz(yada GD seçtiniz ama truetype eklentisiz seçtiniz), phpinfo() yaparak da görebilirsiniz, gd with ttf olması gerekiyor, phpyi tekrar gd ve ttf ile kurun sorun çözülür.

    Sorun gd ttf yüklü olmaması.

    Birde captcha yı neden kendiniz üretiyorsunuz, google ın süper bi api var onu kullanın adamlar her daim captcha güncelleyen kocaman ekipler, neden kolayca kırılabilecek 3rd party bişey kullanmak istiyorsunuz ?

    hatta :

    http://www.youtube.com/watch?v=KFvQf3QwEs4
  • 08-07-2013, 18:54:40
    #7
    lastwisher adlı üyeden alıntı: mesajı görüntüle
    Öncelikle;

    imagettfbbox() php ile tanımlı bir fonsion değil GD kütüphanesinin fonsionu. Fonsionu paylaşırmısın demiş birisi başka tanımlı bir fonsion sanmış sanıyorum belki de C kodlarını istiyordur gd kütüphanesinin

    Sorununuz php versionundan değil, ben size direk doktor house edasoyla anlatayım;

    Php güncellemek için easyapache kullandınız versionu yükseltip next next dediniz ve kurdunuz kurulumu yaparken GD kütüphanesini seçmediniz(yada GD seçtiniz ama truetype eklentisiz seçtiniz), phpinfo() yaparak da görebilirsiniz, gd with ttf olması gerekiyor, phpyi tekrar gd ve ttf ile kurun sorun çözülür.

    Sorun gd ttf yüklü olmaması.

    Birde captcha yı neden kendiniz üretiyorsunuz, google ın süper bi api var onu kullanın adamlar her daim captcha güncelleyen kocaman ekipler, neden kolayca kırılabilecek 3rd party bişey kullanmak istiyorsunuz ?
    hocam en son çağre google kullancaktım zaten , yardımınızdan dolay teşekkür ederim.
  • 09-07-2013, 00:29:15
    #8
    Reveloper
    monofont.ttf dosyasını captcha dosyasının bulunduğu yere atıcaksın kardeşim

    var $font = 'monofont.ttf';

    http://www.allfreefonts.com/font-8133-monofonto.html
  • 09-07-2013, 01:21:40
    #9
    Burti adlı üyeden alıntı: mesajı görüntüle
    monofont.ttf dosyasını captcha dosyasının bulunduğu yere atıcaksın kardeşim

    var $font = 'monofont.ttf';

    http://www.allfreefonts.com/font-8133-monofonto.html
    onunla bir alakası yok , zaten aynı dizindeler.