我的第一个PHP程序_PHP教程
时间:2021-07-01 10:21:17
帮助过:18人阅读
echo "我的计算器";
?>
我的计算器
$num1 = $_POST['num1'];
$num2 =$_REQUEST['num2'];
$run = $_REQUEST['run'];
switch($run)
{
case '+':print("两数之和为:".($num1+$num2));break;
case '-':print("两数之差为:".($num1-$num2));break;
case '*':print("两数之乘积为:".($num1*$num2));break;
case '/':print("两数之和为:".($num1/$num2));break;
}
?>
本文出自 “ITeamsky-杨波的技术空间” 博客
http://www.bkjia.com/PHPjc/478672.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478672.htmlTechArticlehtml head title ?php echo 我的计算器; ? /title /head script type=text/javascript function Onclick() { var num1 = document.getElementById(num1).value; var num2 = document.getEl...