1. There is typo here:
$query = "SELECT sl, types from `products`";
but
echo "<option value="" . $row[" id="] . "">" . $row['types'] . "</option>";
When submit button is clicked, it is the id not the types that is posted to the php script.
2. For the jQuery part, it should be:
<script>
$(document).ready(function() {
$( "#eproducts" ).change(function () {
$( "#product_hidden" ).val($( "select option:selected" ).text());
})
});
</script>