E
E
Eugene2016-11-03 19:30:54
PHP
Eugene, 2016-11-03 19:30:54

PHP & CURL Can't keep up with captcha. How to enter captcha manually?

There is a site on which I am trying to log in using php and curl. I found a page where you need to send a request and what parameters (login, password, captcha). I enter the username and password correctly, but I can’t guess what the captcha will be. I found a captcha url, but for me (user) and curl (server) it is generated differently.
I am new to both php and curl. And I want to authorize from my site (local server) on another site, I intend to manually enter the captcha. I just can’t figure out how to enter it manually, if the curl sees one captcha, and I see another. Is it possible somehow before sending the data (login/password) by the curl to see the captcha that is intended for the curl???
Perhaps you need to use ajax or something else additionally. Guru, please guide me.
Actually here is the code I'm working with:

<?php
        
        
        
        echo '<img style="-webkit-user-select: none" src="http://models.webcambusiness.com/img.php">'; // тут капча, которая генерируется для курла и для меня отдельно и я не могу её угадать
        
        
        $site =('http://models.webcambusiness.com/api/login/'); // сюда делаю запрос и тут хочу авторизоваться
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $site);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, 'username=Login&password=12345&verify=КАПЧА'); // username=ЛОГИН&password=ПАРОЛЬ&verify=КАПЧА Такие данные нужно вводить
        $text = curl_exec($curl);
        echo $text;
        

      ?>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Ne-Lexa, 2016-11-03
@rpgeha

The site/Captcha sets cookies, you need to transfer them as well, via curl.

D
Dimonchik, 2016-11-03
@dimonchik2013

www.telerik.com/fiddler

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question