Every time a POST value is not equal to the list of values set in an array will return: Undefined Index error, I made an if statement but is not working.
Here\'s the
You could also try
$product = (isset($_POST['product'])) ? $_POST['product'] : null;
This will set $product to the $_POST value if it exists, or to null if not. Then you could try
if ($product) {
do_something();
}
or access your array with
$products[$product];
I feel this way it makes your code that little bit easier on the eyes..