找回密码
 立即注册
搜索
热搜: 生活 中国

加法计算器

[复制链接]
admin 发表于 2013-10-2 20:32:30 | 显示全部楼层 |阅读模式
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  4. <title>加法计算器</title>
  5. </head>
  6. <body>
  7. <blockquote>
  8.   <blockquote>
  9.     <blockquote>
  10.       <p class="STYLE1">加法计数器</p>
  11.     </blockquote>
  12.   </blockquote>
  13. </blockquote>
  14. <form id="form1" name="form1" method="post" action="">
  15.   <label>
  16.   <input name="number1" type="text" id="number1" size="10" />
  17.   </label>
  18.   +
  19.   <label>
  20.   <input name="number2" type="text" id="number2" size="10" />
  21.   </label>
  22.   <label>
  23.   <input type="submit" name="Submit" value="等于" />
  24.   </label>
  25. <?php
  26. if(isset($_POST['Submit']) and $_POST['number1']!=null and $_POST['number2']!=null and $_POST['Submit']=="等于"){
  27.         $number3=$_POST['number1']+$_POST['number2'];                //计算变量
  28.         }else{
  29.         $number3=null;
  30.         }
  31. ?>
  32.   <label>
  33.   <input name="number3" type="text" id="number3" size="10" value="<?php echo $number3;?>"/>                <!--输出变量值-->
  34.   </label>
  35. </form>
  36. </body>
  37. </html>
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|生活导航|生活导航 ( 新ICP备12003026-1号 )

GMT+8, 2024-5-9 16:22 , Processed in 0.081829 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表