Jump to content

not working? I'm really messing up somewhere and I am not sure what -simple


ricky_vancouver

Recommended Posts

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.