In this code:
<?
if ($submit)
{
$x = 1;
$y = 2;
$z = $x * $y;
echo $z;
}
?>
$submit is a boolean variable - meaning it has a value of true (1) or false (0). So $submit may have been set something like this:
<?php
$submit = ($a<$b);
?>
So if $a is less than $b, $submit is true and the commands within the if statement will be executed. If $a is not less than $b, then $submit is false and the commands within the if statement will not be executed.
Your code isn't valid because you don't have anything that will be true or false after the if. The code must follow this syntax:
if (x) {
y;
}
where x is a variable or comparison that will be true or false - such as $a < $b, $submit, $a == 3, etc.
and y is any list of statements you want to execute.
I hope this is clearer now!