jsq.php
<?php
if( isset($_POST['sub']) ) {
echo "用户是提交了";
} else {
echo "用户是在刷新";
}
echo '<br>';
?>
<html>
<head>
<title>简单计算器</title>
</head>
<body>
<table border="0" width="400" align="center">
<form action="jsq.php" method="post">
<caption><h1>简单计算器</h1></caption>
<tr>
<td>
<input type="text" size="5" name="num1" value="" /> <br>
</td>
<td>
<select name="ysf">
<option value="+"> + </option>
<option value="-"> - </option>
<option value="x"> x </option>
<option value="/"> / </option>
<option value="%"> % </option>
</select>
</td>
<td>
<input type="text" size="5" name="num2" value="" /> <br>
</td>
<td>
<input type="submit" name="sub" value="计算">
</td>
<tr>
</form>
</table>
</body>
</html>