0

I'm having an issue with one of the forms that I've created. See my HTML code:

<div class="form-group">
  <label for="team" class="col-sm-2 control-label">Team</label>
  <div class="col-sm-10">
    <button style="width:auto;" class="btn btn-default dropdown-toggle form-control" type="button" name="team_name" value="" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
      Select Team
      <span class="caret"></span>
    </button>   
    <ul class="dropdown-menu" value="" name="team_name" aria-labelledby="dropdownMenu1" id="team_name">
      <li><a href="#">Team 1</a></li>
      <li><a href="#">Team 2</a></li>
      <li><a href="#">Team 3</a></li>
      <li><a href="#">Team 4</a></li>
    </ul>
  </div>
</div>

And then my PHP code:

include 'database_connection.php';

$id = mysqli_real_escape_string($connection, $_POST['id']);
$first_name = mysqli_real_escape_string($connection, $_POST['first_name']);
$last_name = mysqli_real_escape_string($connection, $_POST['last_name']);
$team = mysqli_real_escape_string($connection, $_POST['team_name']);    
$role = mysqli_real_escape_string($connection, $_POST['role']);
$email = mysqli_real_escape_string($connection, $_POST['email']);
$phone = mysqli_real_escape_string($connection, $_POST['phone']);
$region = mysqli_real_escape_string($connection, $_POST['region']);

What is my issue here? My form is sending everything else to the PHP variable other than $team variable. How do I fix this so that whatever value I select from the drop down menu goes to the $team variable on the PHP page.

George Baca
  • 179
  • 1
  • 3
  • 14

0 Answers0