title: How to call a php function on a html text click?
body: <p>I want to call php function while call that function I need to pass parameter, when click on some text, It has to call the method called test();
  How to do this.</p>
  
  <p>I don't know anything about ajax.I have taken this code to try it.To try I have used simple code it is also not working. </p>
  
  <p>This is Ajax.html file</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;body&gt;
    &lt;p&gt;Click Me&lt;/p&gt;
  
  &lt;script&gt;
      $(document).ready(function() {
      $("p").click(function(){
      $.ajax({
      url:"script.php", //the page containing php script
      type: "POST", //request type
      success:function(result){
      alert(result);
      }
    });
  });
  })
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>script.php contains,</p>
  
  <pre><code>&lt;?php 
  function test(){
    echo "Hello";
    }
   ?&gt;
  </code></pre>
  
  <p>how to call php function when user click on some text.where I have to call that test() method. Can Any one help me?</p>