You have to check, the form is submitted or not.
<?php
if(isset($_POST['submit']))
{
exec('java -jar "C:temptest.jar" -db dbs.zed.bvba.com -h 10.222.222.22 -new 1', $response);
print nl2br(print_r($response, true));
}
?>
You have to check, the form is submitted or not.
<?php
if(isset($_POST['submit']))
{
exec('java -jar "C:temptest.jar" -db dbs.zed.bvba.com -h 10.222.222.22 -new 1', $response);
print nl2br(print_r($response, true));
}
?>
So when I load my HTML page, it automatically runs the exec()
command by default.
How do I make it so like when it only runs when I press the submit button and not my default?
<form action="site.php" method="POST">
<input type="text" id="fname" name="fname"><br><br>
<input type="text" id="lname" name="lname"><br><br>
<input type="submit" value="Show values">
</form>
</body>
</html>
<?php
exec('java -jar "C:temptest.jar" -db dbs.zed.bvba.com -h 10.222.222.22 -new 1', $response);
print nl2br(print_r($response, true));
?>
Does this answer your question?
You should be