title: PHP POST value from <input> that was created with While loop
body: <p>I am attempting to create a page that displays buttons that are associated to an account number that is a primary key in a database. When I click on the button I want that button to take its value and assign it to a variable that can be used for loading information into a profile page that will load after the button click.</p>
  
  <p>After the button click I would like to load a profile page that uses the value (acc_ID) to load each of the profile attributes (name, location, etc) from a database. I have the functionality to do this already because I have it set up for when a user logs in they see their information populate in their profile page.</p>
  
  <p>So far I have a While loop that populates a table with all of the player account numbers and "View Profile" buttons. Each button is assigned the player account number as a value and is also part of the name.</p>
  
  <pre><code>$query = "SELECT * FROM player";
  $result = mysqli_query($conn, $query);
  echo "&lt;table&gt;
  &lt;tr&gt;
  &lt;th&gt;View Profile&lt;/th&gt;
  &lt;th&gt;Acct Id&lt;/th&gt;
  &lt;/tr&gt;";
  while($row = mysqli_fetch_array($result))
  {
  echo" &lt;form action='php/createPlayerProfilesList.php'&gt;";
  echo "&lt;tr&gt;";
  echo"&lt;td&gt; &lt;input type='submit' name='submit-'.$row[acc_ID].'' value='View 
  Profile - $row[acc_ID]'&gt;   &lt;/input&gt; &lt;/td&gt;";
  echo "&lt;td class='viewProfile'&gt;&lt;input name='player[]' class='getPlayerId' 
  readonly type='text' value='". $row['acc_ID'] ."' &gt; " . $row['acc_ID'] . " 
  &lt;/input&gt;&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['player_FName'] . "&lt;/td&gt;";
  echo "&lt;td&gt;" . $row['player_LName'] . "&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  echo "&lt;/form&gt;";
  }
  echo "&lt;/table&gt;";
  </code></pre>
  
  <p>What I can't figure out is how to display the players profile information into a profile template after I click on their specific View Profile button which takes me to the profile.php template. I know how to load the information into the profile template based on acc_ID because it does that when they login but I can't figure this one out.</p>
  
  <p>This is a sample of the profile code that populates the template based on what acc_ID is the SESSION variable.</p>
  
  <pre><code>session_start();
  include("navbarphp.php");
  
  if($_SESSION['person_type'] == 'P'){
  $acct_ID = $_SESSION['acc_ID'];
  $query = "SELECT * FROM player WHERE acc_ID = '$acct_ID'";
  $result = mysqli_query($conn, $query);
  while($row = $result-&gt;fetch_assoc()){
              $location = $row['player_location'];
              $fname = $row['player_FName'];
              $lname = $row['player_LName'];
              $school = $row['high_school'];
              $gpa = $row['GPA'];
              $bio = $row['BIO'];
              $pos = $row['position'];
              }
  }
  </code></pre>
  
  <p>I searched for a good while on this site and had a couple things that helped but in the end I still am not able to pass a specific View Profile button value. Any help would be great. Thanks</p>