Actually, there is only one part to that statement.
$POST["name1"] is the name of the variable, or I should say, the method of retrieving the value from your form input when you do the HTTP post. For every input element you have in a form that submits a value, there will be a $POST["variable_name"] variable set for it.
So, the if (isset($_POST["name1"])) statement says, "if there is a value set for the posted 'name1' variable, the do something".
If there is any value set on the posted variable 'name1', that statement evaluates to true, otherwise, it is false.
There is a couple reasons I can think of for why it isn't working for you.
- you are not doing a proper HTTP post
- you are using a version of PHP that doesn't support $_POST["variable"] syntax
- there is some code between where you assign the $var variable ($var3 = $_POST[name1]😉 and where your SQL happens that messes with the $var3 variable.
One last thing, be careful of allowing users to type in stuff that get's put into an SQL query, people can do bad things to your system if you don't check what they type in.