PHP Script Question
Posted: Mon Aug 18, 2003 8:16 pm
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:
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.
Help?
Mman
?>
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:
Code: Select all
<?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");
}
?>Help?
Mman
?>