title: Undefined index php
body: <p>My issue is that I am making a dating site form with following categories </p>
  
  <p><code>firstname,lastname,username,password,email,mysex,yoursex,relationship,date of birth, and country</code> </p>
  
  <p>I did the whole php code so when submitted would send info to sql server. But there is some error on php half, date of birth(DOB) day,month,year. And <code>mysex</code> and <code>yoursex</code> values are not submitting. Sql gives undefined index. Here is my code.(The falf that is not submitting)</p>
  
  <pre><code>&lt;form action="process.php" method="post" id="register" class="col-xs-12"&gt; 
  &lt;input class="register-switch-input" type="radio" name="mysex" value="hombre" id="me-male" &gt; &lt;label class="register-switch-label" for="me-male"&gt; Hombre &lt;/label&gt;
  &lt;input class="register-switch-input" type="radio" name="mysex" value="mujer" id="me-female"&gt; &lt;label class="register-switch-label" for="me-female"&gt; Mujer &lt;/label&gt; &lt;br&gt;  
  
  &lt;input type="radio" name="yoursex" value="hombre" id="your-male" checked&gt; &lt;label for="your-male"&gt; Hombre &lt;/label&gt;
  &lt;input  type="radio" name="yoursex" value="mujer" id="your-female"&gt; &lt;label for="your-female"&gt; Mujer &lt;/label&gt; 
  &lt;input type="radio" name="yoursex" value="cualquiera" id="cualquiera"&gt;  &lt;label for="cualquiera"&gt;Cualquiera &lt;/label&gt; &lt;br&gt; 
  
  &lt;label class="form-label"&gt;Nacimiento:&lt;/label&gt;
     &lt;select name="DOBMonth" &gt;
     &lt;option&gt; - Month - &lt;/option&gt;
     &lt;option value="January"&gt;January&lt;/option&gt;
     &lt;option value="Febuary"&gt;Febuary&lt;/option&gt;
      ""
  
  &lt;select name="DOBDay" &gt;
   &lt;option&gt; - Day - &lt;/option&gt;
   ""
  
  &lt;select name="DOBYear"&gt;
    &lt;option&gt; - Year - &lt;/option&gt;
    &lt;option value="2003"&gt;2003&lt;/option&gt;
  </code></pre>
  
  <p>The "" is because the selects have a million options and are unnessecary.
  Here is my php code</p>
  
  <pre><code> &lt;?php
  $servername = "localhost";
  $username = "diego966";
  $password = "ddddd966";
  $dbname= "signup";
  
  // Create connection
  $conn = new mysqli($servername, $username, $password, $dbname);
  // Check connection
  if ($conn-&gt;connect_error) {
  die("Connection failed: " . $conn-&gt;connect_error);
  } 
  
  $firstname = $_POST["firstname"];
  $lastname = $_POST["lastname"];
  $username = $_POST['username'];
  $password = $_POST['password'];
  $email = $_POST['email'];
  $mysex = $_POST["mysex"];
  $yoursex = $_POST["yoursex"];
  $relationship = $_POST['relationship'];
  $DOBday = $_POST['DOBday'];
  $DOBmonth = $_POST['DOBmonth'];
  $DOByear = $_POST['DOByear'];
  $country = $_POST['country'];
  
  
  
  
  $sql="INSERT INTO accounts(firstname, lastname, username, password, email, mysex, yoursex, relationship, DOBday, DOBmonth, DOByear, country)
          VALUES ('$firstname', '$lastname','$username', '$password', '$email','$mysex', '$yoursex', '$relationship', 'DOBday', 'DOBmonth ','DOByear', '$country')"; 
  
  if ($conn-&gt;query($sql) === TRUE) {
  echo "New record created successfully";
  } else {
  echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error;
  }
  
  $conn-&gt;close();
  ?&gt;
  </code></pre>