The question is: how to get the value of data that the php server js sends to the script in text format (which would then make a check, for example if(data == "true") ).

Js:

 $.post('check.php', {'login':login}, function(data) { if(data == "true"){ //code }else if(data == "false"){ //code } }); 

Php:

 <?php $login = $_POST['login']; echo("$login"); ?> 
  • Can I have a little more code? How is it transmitted and where? - Oleksandr
  • are you talking about the data attribute ?? - Kirill Korushkin pm
  • no, you're not talking about the data attribute =) - Kirill Korushkin
  • You have already received them - function (data) {; if (data) checks empty / not empty - Kirill Korushkin
  • I need not just to check empty / not empty, but to check the text itself, which the server transmitted ( "true"/"false" ) - Ivan Repin

0