1.å¦ä½ç¨PHPåç计ç®å¨å
å¦ä½ç¨PHPåç计ç®å¨å
<?计p简龚俊直播源码php/
*** Created by PhpStorm.
* User: ITAK
* Date: /3/3
* Time: :
*/
error_reporting(E_ALL & ~E_NOTICE); if(isset($_POST['submit'])){ $ok = true; $error = "åºç°çé®é¢ï¼<br>"; if($_POST['num1'] == ""){ $ok = false; $error = $error."第ä¸ä¸ªæ°åä¸è½ä¸ºç©º<br>";
} else{ if(!is_numeric($_POST['num1'])){ $ok = false; $error = $error."第ä¸ä¸ªæ°åä¸æ¯æ°å<br>";
}
} if($_POST['num2'] == ""){ $ok = false; $error = $error."第äºä¸ªæ°åä¸è½ä¸ºç©º<br>";
} else{ if(!is_numeric($_POST['num2'])){ $ok = false; $error = $error."第äºä¸ªæ°åä¸æ¯æ°å<br>";
}
}
} if($ok){ $sum = ""; $fuhao = $_POST['fuhao']; if($fuhao == '+') $sum = $_POST['num1'] + $_POST['num2']; if($fuhao == '-') $sum = $_POST['num1'] - $_POST['num2']; if($fuhao == '*') $sum = $_POST['num1'] * $_POST['num2']; if($fuhao == '/') $sum = $_POST['num1'] / $_POST['num2']; if($fuhao == '%') $sum = $_POST['num1'] % $_POST['num2'];
} echo "<br>";?><html>
<head>
<meta charset="UTF-8">
<title>ç®å计ç®å¨</title>
</head>
<body>
<table border="0" width="" align="center">
<form action="cal.php" method="post">
<caption><h1>ç®å计ç®å¨</h1></caption>
<tr>
<td>
<input type="text" size="5" name="num1" value="<?php echo $_POST['num1'] ?>"/>
</td>
<td>
<select name="fuhao">//ä¸æå表 <option <?php if($_POST['fuhao']=="+") echo "selected"?>
value="+"> + </option>
<option <?php if($_POST['fuhao']=="-") echo "selected"?>
value="-"> - </option>
<option <?php if($_POST['fuhao']=="*") echo "selected"?>
value="*"> * </option>
<option <?php if($_POST['fuhao']=="/") echo "selected"?>
value="/"> / </option>
<option <?php if($_POST['fuhao']=="%") echo "selected"?>
value="%"> % </option>
</select>
</td>
<td>
<input type="text" name="num2" size="5" value="<?php echo $_POST['num2'] ?>"/>
</td>
<td>
= </td>
<td>
<input type="text" name="res" size="5" value="<?php echo $sum ?>"/>
</td>
</tr>
<tr align="center">
<td>
<input type="submit" value="计ç®" name="submit">
</td>
</tr>
<br>
<tr>
<td colspan="4">
<?php
if($ok){ echo "ç»æ为: { $_POST['num1']} { $_POST['fuhao']} { $_POST['num2']} = { $sum}";} else{ echo $error;} ?>
</td>
</tr>
</form>
</table>
</body></html>
2024-11-25 02:07934人浏览
2024-11-25 01:49720人浏览
2024-11-25 01:47233人浏览
2024-11-25 01:472582人浏览
2024-11-25 00:2980人浏览
2024-11-25 00:042289人浏览
1.购买app直播源码有什么好处2.有一个APP的源代码怎么运营3.成品app直播源码有什么用4.上海app推广做的好的公司有哪家?aso优化团队做的好的。5.成品网站W灬源码入口APP入口重新开放-
1.大家有哪一些好用的微信小程序商城可以推荐一下的?2.开源的CRMEB小程序商城源码怎么样?3.买源码哪个网站比较靠谱?推荐几个国内精品靠谱的商业源码采购平台4.源码商城交易平台源码推荐 :让你的开
1.什么叫端游什么叫端游 端游就是客户端游戏,即下载安装包在电脑上玩的游戏。 端游,是相对于“网页游戏”所产生的新名词,全称是“客户端游戏” ,是传统的依靠下载客户端,在电脑上进行游戏的网络游