The essence of the problem lies in the button. How should she work? The button must not be active until the user completes the captcha. After the captcha has been executed, the button must be active and after clicking the user it is credited +1 point to the balance. But the button does not work at all. Nothing happens. Why? Not clear. I ask for help! Button code:
<form action="pay" method="post"> <div id="money_captcha_wrapper" class="money_captcha_wrapper"> <script type="text/javascript" src="https://moneycaptcha.ru/captcha.php?siteid=33075&charset=utf-8&button=moneycaptchasubmit"></script> </div> <input name="moneycaptcha_code" id="moneycaptcha_code" type="hidden" value=""> </form> <br><br> <input type="submit" value="Отправить данные" name="moneycaptchabottom" id="moneycaptchasubmit" title="Вам необходимо правильно ответить на капчу"><img scr="/template/images/bottom.png"></> Code to be executed after pressing the button:
<?php if(!isset($Functions)){ die("Error! 404"); } $user = $Functions->getUser(); $payment = '1'; if(isset($_POST['moneycaptchabottom']) { $result = $Functions->giveMoney($user,$payment); } if (isset($_POST['moneycaptcha_code'])) { $handle = curl_init(); curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($handle, CURLOPT_URL, "https://moneycaptcha.ru/valid.php?code=$_POST[moneycaptcha_code]"); curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false); $status = curl_exec($handle); if ( $status === false ) echo "<br>" . curl_error($handle); curl_close($handle); $xml = simplexml_load_string($status); if ($xml->code == "1"){ //Здесь обработчик клиента} }//Конец обработчик клиента }