Q:

combo box posting selection not value not other page submit

I have a Select/Combo Box that I use to select the number of records to display on a page. In order to cover the 'All' option I pass the ID and the Number Selected in the value field.
<?php //get info for results per page combo box //

      $stmt = $db->prepare("SELECT resultspp.ID, resultspp.NumberResults FROM resultspp");
      $stmt->execute();
      $rows2 = $stmt->fetchAll(PDO::FETCH_ASSOC);

              foreach ($rows2 as $row) {
                  if ($pageID !=$row['ID']) { ?> 
                      <option value="<?php echo $row['ID']; ?>|<?php echo $row['NumberResults']; ?>"><?php echo $row['NumberResults']?></option> 
              <?php } else { ?> 
                      <option value"<?php echo $row['ID'];?>|<?php echo $row['NumberResults']; ?>" selected><?php echo $row['NumberResults']?></option>
              <?php }
              }
?> 

This all works fine and the correct values are posted, checked using print_r($_POST). However when another buttom is submitted on the page it posts the option displayed to the user, not the value in the value tag. I have checked this by change the selected option to a constant.
The values are unpacked like so after the post.
<?php
   if($_POST['resultsPP']){
      $pageresult = explode('|', $_POST['resultsPP']);
      $pageID = $pageresult[0];
        if ($pageresult[1] == 'All'){ 
          $number_select = $totalRecords;
        } else {
          $number_select = $pageresult[1];
        }
   }
?>

Thanks in advance

A:

You have missed "=" sign in your code. Below is the updated code. This causing the posting of option instead of posting of value.
.........
    else { ?> 
       <option value="<?php echo $row['ID'];?>|<?php echo $row['NumberResults']; ?>" selected><?php echo $row['NumberResults']?></option>
                                <?php }
.......

