if($_GET!=null){
$num1=$_GET['num1'];
$num2=$_GET['num2'];
$fuhao=$_GET['fuhao'];
$result=0;
if($fuhao=="-"){
$result=$num1-$num2;}
if($fuhao=="*"){
$result= $num1*$num2;}
if($fuhao=="/"){
$result= $num1/$num2;}
if($fuhao=="%"){
$result= $num1%$num2;}
if($fuhao=="+"){
$result= $num1+$num2;}
}else{
$num1=0;
$num2=0;
$fuhao="";
$result=0;
};
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Examples</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
</head>
<body>
<form action="" method="get">
<input value="<?php echo $num1; ?>" type="text" name="num1">
<select name="fuhao">
<option value="+" <?php if($fuhao=="+"){echo "selected";}?>>+</option>
<option value="-" <?php if($fuhao=="-"){echo "selected";}?>>-</option>
<option value="*" <?php if($fuhao=="*"){echo "selected";}?>>*</option>
<option value="/" <?php if($fuhao=="/"){echo "selected";}?>>/</option>
<option value="%" <?php if($fuhao=="%"){echo "selected='selected'";}?>>%</option>
</select>
<input value="<?php echo $num2; ?>" type="text" name="num2">
<input type="submit" value="=">
<input type="text" name="result" value="<?php echo $result;?>">
</form>
</body>
</html>