Support » Plugin: Really Simple CAPTCHA » Show Captcha Image

  • Resolved ejemy

    (@ejemy)


    Greeting,

    i use this plugin and very use full for me.

    i try to use this plugin in the PHP code (i create custom template for my wordpress web)

    but i confused ho to show captcha image, i try this code from description plugin

    $captcha_instance = new ReallySimpleCaptcha();
    $captcha_instance->bg = array( 0, 0, 0 );
    $word = $captcha_instance->generate_random_word();

    $prefix = mt_rand();
    $captcha_instance->generate_image( $prefix, $word );

    echo $word; //this is working show captcha random word

    many thanks before

    Jemy

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Hi Miyoshi-San

    many thanks to answers my question. sorry i newbie in WP and web.

    if i using this script :

    < img class=”wpcf7-form-control wpcf7-captchac wpcf7-captcha-captcha-744″ src=”<?php echo $prefix; ?>.png” alt=”captcha” width=”72″ height=”24″ >

    its correct script to show the image?

    Regards

    Jemy

    • This reply was modified 1 month, 2 weeks ago by ejemy.
    • This reply was modified 1 month, 2 weeks ago by ejemy.
    Plugin Author Takayuki Miyoshi

    (@takayukister)

    I never recommend writing your own code if you are not confident of your coding skills. Coding means you have to be responsible for the every result from your code. If you just want to use Contact Form 7’s script, why don’t you simply use Contact Form 7?

    Greeting Miyoshi-san

    i can solved why the image not showing
    when i use this code :

    $gambar=$captcha_instance->generate_image( $prefix, $word );

    this is will generate image and word, the problem is, location of the file is in
    “plugin directory url” /tmp

    when i use contact form 7 the location is in “/wp-content/upload/wpcf7_captcha/”

    i use this code for get the image :

    $file=”really-simple-captcha”;

    $alamat=plugin_dir_url( $file ) .”really-simple-captcha/tmp/”;

    and for show it

    “<img class=”wpcf7-form-control wpcf7-captchac wpcf7-captcha-captcha-744″
    src=”<?php echo $alamat. $gambar; ?>”
    alt=”” width=”72″ height=”24″>”

    its working good!

    by the way, why i use my own code its , i need really simple captcha for my own form to load my custom data in WP web.

    thank you very much

    Regards

    Jemy

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.