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
@$_POST['product']
(with an @) will return the same thing as :
$product = (isset($_POST['product'])) ? $_POST['product'] : null;
Shorter is sweeter !! 4 times less code ! Easier to read and understand.
The @ symbol is the error control operator (AKA the "silence" or "shut-up" operator). It makes PHP suppress any error messages (notice, warning, fatal, etc.).
But beware not to use @ for any other thing, as it would make your code so much harder to debug!
(this will answer your question before the edit)