Suppose you have the following html select statement
First put a name on your select:
Then
if ($_POST['demo'] === 'Newest') {
// Run this
}
elseif ( $_POST['demo'] === 'Best Sellers' ) {
// Run this
}
or
switch($_POST['demo']){
case 'Newest' :
//some code;
break;
case 'Best Sellers':
//some code;
break;
default:
//some code if the post doesn't match anything
}