1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

decaptcher help via php

Discussion in 'PHP & Perl' started by ps3ubo, Nov 28, 2010.

  1. ps3ubo

    ps3ubo Registered Member

    Joined:
    Jan 25, 2010
    Messages:
    55
    Likes Received:
    2
    can someone help explain how i decaptcha
    http://example.com/captcha.php?sid=646130993849

    using php with api on decaptcher.com (there site doesn't make sense to me)

    p.s would i have to upload the captcha image to my server for it to stay valid with my session?
     
  2. clubbs

    clubbs Newbie

    Joined:
    Jan 5, 2009
    Messages:
    36
    Likes Received:
    8
    There was a decaptcher script posted here to be used in conjuction with imacros. I'll have a search for it tomorrow and edit this post. If I can't find the thread I'll upload the files I have. :)
     
  3. ShiftySituation

    ShiftySituation Power Member

    Joined:
    Apr 15, 2010
    Messages:
    621
    Likes Received:
    314
    Occupation:
    Having fun
    Location:
    Jacksonville, FL
    Wouldn't you use cURL to send the multipart/post data? I'm not sure on the program you are working on. I'm assuming the program is in PHP and running on your server. Which you'd need to download the captcha image (file_get_contents/file_put_contents) and then send it via cURL with your credentials. The cURL response will be the answer string.
     
  4. ps3ubo

    ps3ubo Registered Member

    Joined:
    Jan 25, 2010
    Messages:
    55
    Likes Received:
    2
    I've made the register then upload captcha image to my server, however decaptcher.com api doesn't make much sence to me.
    Where do I POST to via Curl? and what are the things I send through by post?

    Is there an example somewere? There 'download' example page just gives me some very long php that isn't needed to make it work. I just want to no how to use there api so I can implant it to my scripts :)
     
  5. ShiftySituation

    ShiftySituation Power Member

    Joined:
    Apr 15, 2010
    Messages:
    621
    Likes Received:
    314
    Occupation:
    Having fun
    Location:
    Jacksonville, FL
    If you look on their downloads page, you'll see an example of an HTML form submit where you put in your decaptcher login, password and choose the image location of your picture. You would just mimic that in PHP.

    Code:
    $ch = curl_init();
    $data = array('username' => 'UserName', 'password' => 'PassWord', 'pict' => '@/path/to/image.jpeg');
    curl_setopt($ch, CURLOPT_URL, 'http://poster.decaptcher.com/');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    $dataReturned = curl_exec($ch);
    You'll need to add the other values too, but this is their html form example.

    HTML:
    <form 
     method="post" 
     action="http://poster.decaptcher.com/" 
     enctype="multipart/form-data">
     <input type="hidden" name="function"  value="picture2">
     <input type="text"   name="username"  value="client">
     <input type="text"   name="password"  value="qwerty">
     <input type="file"   name="pict">
     <input type="text"   name="pict_to"   value="0">
     <input type="text"   name="pict_type" value="0">
     <input type="submit" value="Send">
    </form>
     
    • Thanks Thanks x 1
  6. ps3ubo

    ps3ubo Registered Member

    Joined:
    Jan 25, 2010
    Messages:
    55
    Likes Received:
    2
    THANK YOU SIR! I have it all working now :) Well now for the next step, verify email address :-\ but I'm sure I can just Google that :D