title: PHP echo selected value from html dropdown list
body: <p>In my dropdown list, i put all the "pack_name(s)" the user has posted and I display it all in the list for the user to select and update. So when the user selects one and hits submit, i want to get that "value" submitted and use it for later purposes but ive been researching and only found "pre-set" values with html and the value was given using Jquery. So i wondering if its possible to basically take the "pack_name" selected and when the user hits submit, echo out the selected value.</p>
  
  <p>PHP</p>
  
  <pre><code>&lt;?php
  session_start();
  
   if(empty($_FILES) &amp;&amp; empty($_POST) &amp;&amp; isset($_SERVER['REQUEST_METHOD']) &amp;&amp; strtolower($_SERVER['REQUEST_METHOD']) == 'post'){ //catch file overload error...
          $postMax = ini_get('post_max_size'); //grab the size limits...
          echo "&lt;p style=\"color: #F00;\"&gt;\nPlease note files larger than {$postMax} will result in this error!&lt;/p&gt;"; // echo out error and solutions...
          return $postMax;
      }
  
  if(isset($_COOKIE['id'])){
  
      if($_SESSION['came_from_upload'] != true){
  
          setcookie("id", "", time() - 60*60);
          $_COOKIE['id'] = "";
          header("Location: developerLogin.php");
          exit;
  
  
      }
  
      try{
  
          // new php data object 
          $handler = new PDO('mysql:host=127.0.0.1;dbname=magicserver', 'root', '');
          //ATTR_ERRMODE set to exception
          $handler-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  
          }catch(PDOException $e){
               die("There was an error connecting to the database");   
  
          }
         $userid = $_SESSION['id'];
         $stmt = $handler-&gt;prepare("SELECT * FROM pack_profile WHERE pack_developer_id = :userid");
         $stmt-&gt;bindParam(':userid', $userid, PDO::PARAM_INT);
         $stmt-&gt;execute();
         echo "&lt;select&gt;";
  
         while($result = $stmt-&gt;fetch()){
           echo "&lt;option&gt;" . $result['pack_name'] ."&lt;/option&gt;";
         }
  
         echo "&lt;/select&gt;";
  
     if($_SERVER['REQUEST_METHOD'] =="POST"){
           $token = $_SESSION['token'];
  
  
  }
  }
  
  
  ?&gt;
  </code></pre>