Simple PHP calculator

前端 未结 11 833
独厮守ぢ
独厮守ぢ 2020-12-14 12:01

I\'m creating a basic PHP calculator that lets you enter two values and chose your operator then displays the answer. Everything is working fine except it\'s not outputting

11条回答
  •  隐瞒了意图╮
    2020-12-14 12:36

    You also need to put the [== 'add'] math operation into quotes

    if($_POST['group1'] == 'add') {
    echo $first + $second;
    }
    

    complete code schould look like that :

    
    

提交回复
热议问题