ricky_vancouver Posted December 12, 2010 Share Posted December 12, 2010 I think it is probably something simple I am missing, I am fairly new to PHP and am putting together a page while doing different experimentation with the language. My problem is that I have a user input for two numbers from a drop down menu. $number1 is the variable from the first menu $number2 is the variable from the second menu $total = $number1 - $number2; However, I always seem to get $total = $number1 It completely ignores the subtraction. I.E. If $number1 is 15 and $number2 is 4 Hitting the send button will get $total = 15 and not the expected value of 11. Link to comment https://forums.phpfreaks.com/topic/221399-not-working-im-really-messing-up-somewhere-and-i-am-not-sure-what-simple/ Share on other sites More sharing options...
Pikachu2000 Posted December 12, 2010 Share Posted December 12, 2010 Try this, and if it doesn't fix it, post your actual code. $total = ($number1 - $number2); Link to comment https://forums.phpfreaks.com/topic/221399-not-working-im-really-messing-up-somewhere-and-i-am-not-sure-what-simple/#findComment-1146197 Share on other sites More sharing options...
ricky_vancouver Posted December 13, 2010 Author Share Posted December 13, 2010 thanks Link to comment https://forums.phpfreaks.com/topic/221399-not-working-im-really-messing-up-somewhere-and-i-am-not-sure-what-simple/#findComment-1146494 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.