<form action="?act=1" method="post">
<input type="text" name="num1" value="<?php echo isset($_POST[‘num1‘])?$_POST[‘num1‘]:‘‘; ?>" />
<select name="ty">
<option <?php if(isset($_POST[‘ty‘]) && $_POST[‘ty‘]==‘+‘){ echo ‘selected‘; } ?> value="+">+</option>
<option <?php if(isset($_POST[‘ty‘]) && $_POST[‘ty‘]==‘-‘){ echo ‘selected‘; } ?> value="-">-</option>
<option <?php if(isset($_POST[‘ty‘]) && $_POST[‘ty‘]==‘*‘){ echo ‘selected‘; } ?> value="*">*</option>
<option <?php if(isset($_POST[‘ty‘]) && $_POST[‘ty‘]==‘/‘){ echo ‘selected‘; } ?> value="/">/</option>
</select>
<input type="text" name="num2" value="<?php echo isset($_POST[‘num2‘])?$_POST[‘num2‘]:‘‘; ?>" />
<input type="submit" value="计算" />
</form>