Как убрать капчу из формы отправки?

(Ответов: 3, Просмотров: 1057)
  1. Новичок
    • Регистрация: 05.04.2012
    • Сообщений: 17
    • Репутация: 0
    На сайте

    тыц

    http://2-step.ru
    [свернуть]
    в левой боковой колонке, есть форма "Заказ звонка специалиста"... Не могу разобраться как убрать капчу из нее. Если просто убрать код из чанка, то при отправке показывает ошибку файла vericode.php файл этот я нашел, а вот что с ним сделать, чтобы ничего не поламать не догоняю.
    Заранее благодарен!
    • 0
  2. Sapienti sat Аватар для brainix
    • Регистрация: 01.01.2013
    • Сообщений: 1,925
    • Записей в дневнике: 1
    • Репутация: 817
    • Webmoney BL: ?
    Экстрасенсов нет. Нужно смотреть код файла vericode.php.
    • 0
  3. Новичок
    • Регистрация: 05.04.2012
    • Сообщений: 17
    • Репутация: 0
    PHP код:
    <?php
    include_once("config.inc.php");

    $vword = new VeriWord(148,60);
    $vword->output_image();
    $vword->destroy_image();

    #captchaClass.php file below

    ## v1 Stable ##

    ######
    ## Verification Word
    ######
    ## This class generate an image with random text
    ## to be used in form verification. It has visual
    ## elements design to confuse OCR software preventing
    ## the use of BOTS.
    ##
    #######
    ## Author: Huda M Elmatsani
    ## Email:   justhuda at netrada.co.id
    ##
    ## 25/07/2004
    #######
    ## Copyright (c) 2004 Huda M Elmatsani All rights reserved.
    ## This program is free for any purpose use.
    ########
    ##
    ## USAGE
    ## create some image with noise texture, put in image directory, 
    ## rename to noise_#, see examples
    ## put some true type font into font directory, 
    ## rename to font_#, see exmplae
    ## you can search and put free font you like 
    ##
    ## see sample.php for test and usage
    ## sample URL: http://www.program-ruti.org/veriword/
    ####
    class VeriWord {

        
    /* path to font directory*/
        
    var $dir_font   "ttf/";
        
    /* path to background image directory*/
        
    var $dir_noise  "noises/";
        var 
    $word       ""
        var 
    $im_width   0;
        var 
    $im_height  0;

        function 
    VeriWord($w=200$h=80) {
            
    /* create session to set word for verification */
            
    startCMSSession();
            
    $this->set_veriword();
            
    $this->dir_font dirname(__FILE__) . '/' $this->dir_font;
            
    $this->im_width         $w;
            
    $this->im_height        $h;
        }

        function 
    set_veriword() {   
            
    /* create session variable for verification, 
               you may change the session variable name */
            
    $this->word             $this->pick_word();   
            
    $_SESSION['veriword']   = $this->word;
        }

        function 
    output_image() {
            
    /* output the image as jpeg */  
            
    $this->draw_image();
            
    header("Content-type: image/jpeg");
            
    imagejpeg($this->im);
        }

        function 
    pick_word() {
            global 
    $database_server$database_user$database_password$dbase$table_prefix$database_connection_charset$database_connection_method;
            
    // set default words
            
    $words="MODx,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote";

            
    // connect to the database
            
    if(@$dbConn mysql_connect($database_server$database_user$database_password)) {
                
    mysql_select_db($dbase);
                @
    mysql_query("{$database_connection_method} {$database_connection_charset}");
                
    $sql "SELECT * FROM $dbase.`".$table_prefix."system_settings` WHERE setting_name='captcha_words'";
                
    $rs mysql_query($sql);
                
    $limit mysql_num_rows($rs);
                if(
    $limit==1) {
                    
    $row mysql_fetch_assoc($rs);
                    
    $words $row['setting_value'];
                }
            }

            
    $arr_words explode(","$words);

            
    /* pick one randomly for text verification */
            
    return (string) $arr_words[array_rand($arr_words)].rand(10,999);
        }   

        function 
    draw_text() {        
            
    $dir dir($this->dir_font);
            
    $fontstmp = array();
            while (
    false !== ($file $dir->read())) {
                if(
    substr($file, -4) == '.TTF') {
                    
    $fontstmp[] = $this->dir_font.$file;
                }
            }
            
    $dir->close();
            
    $text_font = (string) $fontstmp[array_rand($fontstmp)];

            
    /* angle for text inclination */
            
    $text_angle rand(-9,9);
            
    /* initial text size */
            
    $text_size  20;
            
    /* calculate text width and height */
            
    $box        imagettfbbox $text_size$text_angle$text_font$this->word);
            
    $text_width $box[2]-$box[0]; //text width
            
    $text_height$box[5]-$box[3]; //text height

            /* adjust text size */
            
    $text_size  round((15 $this->im_width)/$text_width);  

            
    /* recalculate text width and height */
            
    $box        imagettfbbox $text_size$text_angle$text_font$this->word);
            
    $text_width $box[2]-$box[0]; //text width
            
    $text_height$box[5]-$box[3]; //text height

            /* calculate center position of text */
            
    $text_x         = ($this->im_width $text_width)/2;
            
    $text_y         = ($this->im_height $text_height)/2;
            
            
    /* create canvas for text drawing */
            
    $im_text        imagecreate ($this->im_width$this->im_height); 
            
    $bg_color       imagecolorallocate ($im_text255255255); 

            
    /* pick color for text */
            
    $text_color     imagecolorallocate ($im_text0113188);

            
    /* draw text into canvas */
            
    imagettftext    (   $im_text,
                                
    $text_size,
                                
    $text_angle,
                                
    $text_x,
                                
    $text_y,
                                
    $text_color
                                
    $text_font
                                
    $this->word);

            
    /* remove background color */
            
    imagecolortransparent($im_text$bg_color);
            return 
    $im_text;
            
    imagedestroy($im_text); 
        }


        function 
    draw_image() {
            
            
    /* pick one background image randomly from image directory */
            
    $img_file       $this->dir_noise."noise".rand(1,4).".jpg";

            
    /* create "noise" background image from your image stock*/
            
    $noise_img      = @imagecreatefromjpeg ($img_file);
            
    $noise_width    imagesx($noise_img); 
            
    $noise_height   imagesy($noise_img); 
            
            
    /* resize the background image to fit the size of image output */
            
    $this->im       imagecreatetruecolor($this->im_width,$this->im_height); 
            
    imagecopyresampled ($this->im
                                
    $noise_img
                                
    0000
                                
    $this->im_width
                                
    $this->im_height
                                
    $noise_width
                                
    $noise_height);

            
    /* put text image into background image */
            
    imagecopymerge (    $this->im
                                
    $this->draw_text(), 
                                
    0000
                                
    $this->im_width
                                
    $this->im_height
                                
    100 );

            return 
    $this->im;
        }

        function 
    destroy_image() {

            
    imagedestroy($this->im);

        }

    }
    ?>
    • 0
  4. [web-developer] Аватар для cOAPerator
    • Регистрация: 22.02.2011
    • Сообщений: 615
    • Репутация: 111
    • Webmoney BL: ?
    Цитата Сообщение от eMarketer Посмотреть сообщение
    Если просто убрать код из чанка, то при отправке показывает ошибку файла vericode.php
    какая ошибка то хоть?

    ... что из Вас все вытягивать то нужно...
    Последний раз редактировалось cOAPerator; 30.10.2013 в 22:29.
    • 0

Похожие темы

Темы Раздел Ответов Последний пост
Проходится вводить капчу в Яндекс.Вордстат
Вопросы от новичков 41 08.01.2014 17:31
Гугл постоянно просит ввести капчу
Оффтоп и свободные темы 13 18.08.2013 14:26
Как убрать якорь #more и можно ли убрать отображение изображений с пота с короткой новости?
WordPress 2 28.05.2012 14:17
Делаем оригинальную капчу
Дайджест блогосферы 0 12.05.2010 18:44

У кого попросить инвайт?

Вы можете попросить инвайт у любого модератора:

Информеры