Hy guys. Today i started to learn php and in my first script (a calculator) i have this error message
Parse error: syntax error, unexpected T_LOGICAL_AND, expecting ')' in /home/gameforce/public_html/33/calculator.php on line 5
On localhost i don't have this error.
The php code from "calculator.php" it's:
<?php
$num1 = $_POST['num1'];
$num2 = $_POST['num2'];
$calculator = $num1 + $num2;
if (empty($num1 and $num2)) {
echo 'Ambele campuri trebuie sa fie completate.<br>';
else {
echo 'Rezultatul este ' . $calculator . '.<br>';
if ($calculator >= 10) {
echo 'Rezultatul este mai mare decat 10.<br>';
}
else {
echo 'Rezultatul nu este mai mare decat 10.';
}
}
}
?>
What's the problem?
Thanks and sorry for my bad english.