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

get Capatcha back to user then submits it --PHP--

Discussion in 'PHP & Perl' started by adeladel, Jul 6, 2009.

  1. adeladel

    adeladel Newbie

    Joined:
    Mar 20, 2009
    Messages:
    13
    Likes Received:
    1
    Hello all

    I wonder if we use Curl to submit a form however there is a captcha that exists in that form, Can we get the capatcha back to user so he can write it manually then post it back to the form and submits it?

    I remember that rapidleech script was doing something like this.

    I will be glad if someone answers

    Thanks in advance

    Adel
     
  2. zappak

    zappak Junior Member

    Joined:
    Mar 8, 2007
    Messages:
    101
    Likes Received:
    9
    yeh we can do that, it depends for which form you need it get done
     
  3. XoC--

    XoC-- Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 5, 2009
    Messages:
    211
    Likes Received:
    113
    Yes, first you would GET the page, extract the CAPTCHA image URL and load it onto the page.

    Code:
      curl_setopt($ch, CURLOPT_URL, $URL);
      curl_setopt($ch, CURLOPT_POST, 0);
      curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
      $content = curl_exec ($ch);
      curl_close ($ch);
    
    For example to show Gmails CAPTCHA
    Code:
    echo preg_replace('^(https://www.google.com/accounts/Captcha\?ctoken=.+)\'^', 
    '<img src="$1" />', $content);
    
    Then you can submit for the form data.
     
    Last edited: Jul 11, 2009