0

I want to execute a jar file after getting some input from the web page on button click. I tried php exec method , but it runs the jar file at the time of loading the php page (even before button click).

        <input type="button" title="Generate the summary" name="sum" value="Summarize" id="summarize" onclick="summarize()">
    <script>
        function summarize()
        {
            <?php exec("java -jar summarizer_1.jar ",$output); ?>
            <?php echo $output;?>
        } 
    </script>

some people suggested me AJAX but I think its increasing complications in the code. Can there be a simple solution to this problem?

P.S. I used php only to make the .jar call, php is nowhere useful for me in the code.

Rakhi Oza
  • 75
  • 1
  • 8

0 Answers0