How to send data to php file and return the value in javascript function?
<p>In Js file I've created a function which has to send an id and return boolean value to php file which returns false or true; but how can I do it?</p>

<p>JS function</p>

<pre><code>function findDB(id)
{

}
</code></pre>

<p>PHP side</p>

<pre><code>include_once("kutuphane/inc.php"); 
$id = $_POST['tipi'];

$sql= "select count(id) from bolge_db where parent_id=$id"; 

    $faz2= $_SESSION["VT"]-&gt;doQuery($sql);

 $flag=false;
 if($faz2&gt;0)
  {
    $flag= true;
  }
   else
  {
    $flag= false;
  }
</code></pre>
