New To PHP: Stupid Question...
Posted: Wed Jan 01, 2003 6:20 pm
Here's something for you l33t programmers to laugh at.
I just started with PHP a month or so ago. I wanted to start programming, so I started with PHP because I'd heard it was easy and combines style from many other languages. Anyways, I was trying to make a basic calculator-type program to test my skills, but I keep getting the "unexpected T_ELSE on line 17". I really hope there isn't an embarassing number of errors as I think... Here's the code:
Can anyone figure this out?
I just started with PHP a month or so ago. I wanted to start programming, so I started with PHP because I'd heard it was easy and combines style from many other languages. Anyways, I was trying to make a basic calculator-type program to test my skills, but I keep getting the "unexpected T_ELSE on line 17". I really hope there isn't an embarassing number of errors as I think... Here's the code:
Code: Select all
<html>
<head>
<title>??</title>
</head>
<body>
<?
$a = ""; //Empty string for the action form and my variable number
$b = "5"; //Argument number for $a
$c = $a - $b;
if ($a - $b == "1")
{
print "you haev nailed teh number@!!!!!111";
{
else ($a - $b !== 1) //Line 17
{
print "You are <b> . $c . </b> off";
}
?>
</body>
</html>