Answer the question
In order to leave comments, you need to log in
How to create a captcha form from VK?
The fact is that after many requests in VK, a captcha pops up. I have this captcha in the form action="/api" but in this form there is also a captcha form:
if(isset($request['error']['captcha_img']))
{
echo "<div class=\"callout callout-danger\"> Нужно ввести капчу<br>
<img src=".$request['error']['captcha_img']." alt=\"Captcha\">
<form method = \"post\">
<input type=\"text\" name=\"captcha_key\" required>
<input type=\"hidden\" name=\"captcha_sid\" value=".$request['error']['captcha_sid'].">
<button type=\"submit\" class=\"btn btn-primary\">Отправить</button>
</form>
</div>";
}
Answer the question
In order to leave comments, you need to log in
I didn't look at the code, it's some kind of horror.
How to do it - if an error occurs, you need to repeat the request with the same parameters, but with the addition of captcha parameters. A separate form for captcha is not needed, if an error occurs, it is enough to leave the fields of the usual form filled in as they were filled before sending and add the captcha input field to them, and the captcha itself.
Send a request EXACTLY SAME as all other requests are sent, the only difference is the added captcha parameter.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question