How to work via php?

Hi! Help please. How to work with the program via php? P.s.: Please give a detailed answer...


  • In CB options you need to check "run as webserver"
    In your php script you send a POST request to
  • cherubcherub UK
    edited November 2013 Accepted Answer
    First you'll need CB running as webserver and listening on port 80. Download the captcha image you want to use and save it locally. Next, POST it's full path with the variable name 'file' to You'll then get a result from the program that you can parse.

    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL,"");
    curl_setopt($curl, CURLOPT_POST,1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, "file=C:\temp\captcha.jpg");
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

  • Accepted Answer
    Fully working code :

    $captcha = file_get_contents('');
    file_put_contents(__DIR__ . '/captcha.jpg', $captcha);

    $fields = array(
        'file' => '@' . __DIR__ . '/captcha.jpg',
        'source_url' => '',
        'captcha_platform' => '',
        'action' => 'Submit'

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, '');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $result = curl_exec ($ch);
    curl_close ($ch);

    preg_match('/<span id="captcha_result">(.*)<\/span>/', $result, $matches);
    echo $matches[1];
  • Tell me, please, how OFAC type captchas. Whatever CB worked with captchas for a particular type?
Sign In or Register to comment.