jacomus Posted March 6, 2008 Share Posted March 6, 2008 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. Is there something I am, perhaps, missing? Quote Link to comment Share on other sites More sharing options...
Barand Posted March 6, 2008 Share Posted March 6, 2008 Looks like $number2 is always 0 for some reason. Can't do much more for you without seeing the code. Quote Link to comment Share on other sites More sharing options...
conker87 Posted March 12, 2008 Share Posted March 12, 2008 $number2 is probably null then. Like Barand said, can we see your code. Quote Link to comment Share on other sites More sharing options...
jacomus Posted March 18, 2008 Author Share Posted March 18, 2008 It's cool, I figured it out, newbie error, I was using = instead of ==. Thanks for considering my issue though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.