无法获得所选的下拉值

When I select a value in drop down menu and echo it gives me 1 instead of the selected menu. It isn't getting the value of drop down. Here is my code:

<select id="select2" name="select2" disabled="disabled">
  <option>Select an option</option>
  <?php 
$sql="SELECT DISTINCT names FROM table ";
        
$result = mysqli_query($sql);

while ($row = mysqli_fetch_array($result)) {
    
    echo "<option  class='names' value=' " . $row['names'] ."'>" . $row['names'] ."</option>";
    }
?>
<?php 
$sql="SELECT DISTINCT courses FROM table ";
        
$result = mysqli_query($sql);

while ($row = mysqli_fetch_array($result)) {
    
    echo "<option  class='courses' value=' " . $row['courses'] ."'>" . $row['courses'] ."</option>";
    }
?>
</select>

Here is when I echo the value of drop down, It gives me 1.

$a=isset($_POST['select2']);
echo $a;

</div>

You have included the attribute disabled="disabled". You'll not be able to read the HTML element's value if you include the disabled attribute (at least that's what I have experienced till now). If possible, try to include readonly attribute instead of disabled. That'll provide the value.