Skip to content
Advertisement

Tag: responsetext

how to get the responseText from echo in php

I’m trying to return a value from PHP to JavaScript through responseText. The idea is if mysqli_num_rows($rslt) != 0, responseText = 1, or if mysqli_num_rows($rslt)= 0, to do an insert and responseText = 0, and then in JavaScript I get the responseText. How can I achieve that, because I tried with echo, but I couldn’t find a solution. JavaScript code:

Advertisement