<pre lang="HTML"><pre><html> <body> <head> <title>HTML Forms</title> </head> <p>Add your details:</p> <form name="form" method="get"> Number 1:<br> <input type="number" name="first"> <br> Number 2:<br> <input type="number" name="second"> <br> Number 3:<br> <input type="number" name="third"> <input type="submit" value="submit" id="submit" /> </form> </body> </html>
<pre><?php $var1 = $_GET['first']; $var2 = $_GET['second']; $var3 = $_GET['third']; $command = escapeshellcmd("python total.py $var1 $var2 $var3"); $output = shell_exec($command); echo ($output); ?>
import sys num_1 = sys.argv[1] num_2 = sys.argv[2] num_3 = sys.argv[3] print("total:", num_1+num_2+num_3)
shell_exec
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)