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>
2025-01-19 06:461863人浏览
2025-01-19 06:252460人浏览
2025-01-19 06:03586人浏览
2025-01-19 05:471467人浏览
2025-01-19 05:28593人浏览
2025-01-19 04:581930人浏览
當地時間25日,美國紐約證券交易所發布公告稱,計劃將旗下全電子化交易所NYSE Arca的美股交易時間延長至每個工作日22個小時,待監管批准後實施。圖為美國紐約證券交易所。(資料圖片) 紐交所介紹稱
當地時間4月10日,美國聯邦儲備委員會公布的3月貨幣政策會議紀要顯示,美國通貨膨脹下降速度仍不足以支持推出降息舉措。在確信通脹穩步回歸目標水平之前,美聯儲不會降息。會議紀要顯示,美聯儲官員就通脹問題進
4月12日,美國法官胡安·梅爾尚拒絕了美國前總統特朗普團隊推遲「封口費」案審判日期的請求,該案仍將於4月15日開庭審理。此前,特朗普的律師希望修改陪審團的選拔程序,並尋求無限期推遲審判日期,理由是陪審