title: Problems with $_POST returning undefined index
body: <p>First, yes I know there are other questions VERY similar to this one, but, none quite helped me.</p>
  
  <p>The idea is to send the values via a POST where it should go to the DB and say if the user exists or not.
  But i keep receiving the PHP error, with the use of <code>isset</code> and a ternary operator, I was able to not <strong>receive</strong> the error, but he still persists. for what i can see, the variables are there(formControlName), i'm really lost here.</p>
  
  <p>ERROR:</p>
  
  <pre><code>Notice: Undefined index: email in /srv/http/database_vee/connection_php/connect_user.php on line 11
  
  Notice: Undefined index: password in /srv/http/database_vee/connection_php/connect_user.php on line 12
  { "sucesso": false, "usuario": "" }
  </code></pre>
  
  <p>html form:</p>
  
  <pre><code>&lt;form [formGroup]="formularioLogin" (ngSubmit)="login(formularioLogin.value)"&gt;
  
  &lt;ion-input placeholder="email"  formControlName="email" required="true"&gt;&lt;/ion-input&gt;
  
  &lt;ion-input placeholder="senha"  formControlName="password" required="true"&gt;&lt;/ion-input&gt;
  
  &lt;div class="flexbox-2-of-1"&gt;
    &lt;ion-button fill="clear" type="button" (click)="cadastrar()"&gt;Cadastrar&lt;/ion-button&gt;
    &lt;ion-button color="dark" type="submit" [disabled]="formularioLogin.invalid"&gt;Entrar&lt;/ion-button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>.ts file</p>
  
  <pre><code>export class LoginPage {
  
    formularioLogin;
  
    constructor(private toastController: ToastController,
      private navCtrl: NavController,
      private formBuilder: FormBuilder,
      private userService: UserService,
      private storage: Storage) {
  
      this.formularioLogin = this.formBuilder.group({
        email: "",
        password: ""
      });
    }
  
    async presentToast() {
      const toast = await this.toastController.create({
        message: 'Usuário não encontrado!',
        duration: 2000
      });
      toast.present();
    }
  
    login(dadosLogin: any) {
  
      const formData = new FormData();
      formData.append("email", dadosLogin.email);
      formData.append("password", dadosLogin.password);
  
      this.userService.login(formData).subscribe((data: any) =&gt; {
        console.log(data);
  
        if (data.sucesso) {
          this.storage.set("user", data.user).then(() =&gt; {
            this.navCtrl.navigateRoot("/home");
          });
        } else {
          this.presentToast();
        }
      });
  
      console.log(dadosLogin);
  
  
  
    }
  </code></pre>
  
  <pre><code>&lt;?php
      header("Access-Control-Allow-Origin: *");
  
      require_once("./connect_bd.php");
  
      $connect = AbreConexaoBD();
  /* 
      $user_mail = (isset($_POST["email"]) ? $_POST['email'] : '');
      $user_password = (isset($_POST["password"]) ? $_POST['password'] : ''); 
   */
      $user_mail = $_POST["email"];
      $user_password = $_POST["password"];
  
      $sql = "SELECT id, name FROM tb_user
               WHERE user_mail = '".$user_mail."'
                 AND user_password = '".$user_password."'";
  
      $resultado = mysqli_query($connect, $sql);
      if (mysqli_num_rows($resultado) &gt; 0) {
          $user = mysqli_fetch_assoc($resultado);
          echo '{ "sucesso": true, "usuario": { "id": '.$user["id"].', "nome": "'.$user["name"].'" } }';
      } else {
          echo '{ "sucesso": false, "usuario": "" }';
      }
  
  ?&gt;
  </code></pre>