i have a problem when posting a captcha to validate by php.
I send the captcha_value
string to the captcha_check.php and I don't know how to retrieve the returned value 'true' or 'false'
$("#myForm").submit(function() {
$.ajax({
type: "POST",
url: '/captcha_check.php',
data: captcha_value
success: function(data) {
**?WHAT TO DO HERE? how to get true or false**
}
});
captcha_check.php
<?php
if ($_POST['captcha'] == $_SESSION['captcha'])
echo 'true';
else
echo 'false';
?>