PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Before you speak, please know that I'm very knew to PHP. I'm what you could called a 'n00b', but I prefer Scripter In Training.
This is a script that takes user input and calculates it. Basically it's a simple calculator script.Anyhow, I wrote this script the other day but have been having problems with it:
<?php
if ( $Action = Add ) {
$Result = $Number1 + $Number2
print ("$Number1 plus $Number2 is $Result");
}
if ( $Action = Subtract ) {
$Result = $Number1 - $Number2
print ("$Number1 minus $Number2 is $Result");
}
if ( $Action = Multiply ) {
$Result = $Number1 * $Number2
print ("$Number1 plus $Number2 is $Result");
}
else
{
$Result = $Number1/$Number2
print ("$Number1 divided by $Number2 is $Result");
}
?>
At first, it came up with a parse error on line six, because the I forget the ';' after the print () function. However, now it is producing a parse error on line 23 or 29 I think it was. I really don't know what's wrong. It seems fine to me.