okay, except you define those variables before you even know whether or not "products.php" has been submitted to -- it obviously has not, which means those variables aren't set.
even still, you didn't answer anything I asked in my post. I don't know how to "fix" your code if it's a A) a complete mess and un-runnable as is (second line in my post), and B) you can't tell me what it's doing wrong.
if the only problem is that you're getting is undefined indexes, then just make sure those variables exist before assigning values.
PHP Code:
if(isset($_POST['var1'], $_POST['var2'])){
$myvar1 = $_POST['var1'];
$myvar2 = $_POST['var2'];
}