title: form submit php function return value print in html
body: <p>I have a html form. when i submit the form, it manages to call a function. i want to show the result in the html page. the picture is like this:
  <strong>THE HTML</strong></p>
  
  <pre><code>&lt;form method="post" action="" enctype="multipart/form-data" name="uploadForm"&gt;
  &lt;input name="test" /&gt;
  &lt;input type="submit" name="submit" /&gt;
  &lt;/form&gt;
  
  &lt;div id="data"&gt;&lt;?php echo $result; ?&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>PHP CLASS</strong></p>
  
  <pre><code>&lt;?php
  class Test{
  
      public function __construct(){
          if(isset($_POST['submit'])){
              $result = $this-&gt;myfunction();
          }
      }
          private function myfunction(){
          //some actions
          return "values";
          }
  }
  </code></pre>
  
  <p>I am just giving the idea. the class file is different php file and so the html is. the instance of the class is created. how can i show the result "values" in the div id="data" after submitting the form?</p>