我正在用 PHP 创建一个计算器,我的 HTML 应该有这种结构,其中我的数字是可点击的按钮,第一次点击的数字将是第一个值,我点击的第二个数字将是第二个值. 我不知道它会如何工作,这可能吗?如果是这样,这是我的代码
<html>
<head>
<title>Calculator</title>
</head>
<body>
<div id = "structure">
<?php
if(isset($_GET)){
$value += $_GET;
}
?>
<form method = "GET " action = "calculator.php">
<input type = "submit" name = "one" value = 1>
<input type = "submit" name = "two" value = 2>
<input type = "submit" name = "three" value = 3>
<input type = "submit" name = "operand" value = "+">
</br>
<input type = "submit" name = "four" value = 4>
<input type = "submit" name = "five" value = 5>
<input type = "submit" name = "six" value = 6>
<input type = "submit" name = "operand" value = "-">
</br>
</form>
</div>
</body>
</html>
我没有将所有数字都放在计算器中以用于发布目的