I saw a calculator written in PHP on the Internet, but it cannot achieve calculation output. Please help!-PHP Chinese Network Q&A
I saw a calculator written in PHP on the Internet, but it cannot achieve calculation output. Please help!
季风
季风 2018-04-25 17:05:33
0
3
1419

如题,源码如下

简易计算器

$num1 = $_GET["num1"];

$num2 = $_GET["num2"];

if($_GET["ysf"]==" ")

$sun = $num1 $num2;

if($_GET["ysf"]=="-")

$sun = $num1-$num2;

if($_GET["ysf"]=="*")

$sun = $num1*$num2;

if($_GET["ysf"]=="/")

$sun = $num1/$num2;

?>

if(isset($_GET["sub"]))

echo $sun;

?>


季风
季风

reply all (2)
猪哥

There is no problem after reading the code. The final output is


    无忌哥哥

    Look at what the error is

    • reply No error was reported, but the final calculated result was not displayed. Did I miss something?
      季风 author 2018-04-26 14:38:23
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!