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: THE HTML
<form method="post" action="" enctype="multipart/form-data" name="uploadForm">
<input name="test" />
<input type="submit" name="submit" />
</form>
<div id="data"><?php echo $result; ?></div>
PHP CLASS
<?php
class Test{
public function __construct(){
if(isset($_POST['submit'])){
$result = $this->myfunction();
}
}
private function myfunction(){
//some actions
return "values";
}
}
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?