1 回答

TA貢獻1798條經(jīng)驗 獲得超3個贊
您可以簡單地使用 adot并將字符串與變量組合。例如:
$var = "yourname";
echo "hello " . $var . ", how are you?;
// prints "hello yourname, how are you?"
在你的情況下,你可以使用這個:
if(isset($_POST['submit'])) {
$var1 = $_POST['var1'];
$var2 = $_POST['var2'];
$getal = $_POST['getal'];
exec('java -jar "test.jar" -db ' . $var1 . ' -h ' . $var2 . ' -new ' . $getal, $response);
print nl2br(print_r($response, true));
}
你的表格:
<form action="" method="post">
<input type="text" value="" name="var1">
<input type="text" value="" name="var2">
<input type="text" id="getal" value="" name="getal">
<input type="submit" name="submit" value="Show">
</form>
- 1 回答
- 0 關注
- 100 瀏覽
添加回答
舉報