title: PHP POST + iOS Swift error
body: <p>I'm having trouble with my App, what I am trying to do is send some information from my textfields through a "NSMutableURLRequest" URL to a PHP file I have.</p>
  
  <p>The error says there are undefined indexes for each of my vars. </p>
  
  <p>This is the first time I do this kind of exercises so I don't know if the error is in my PHP code or in the Swift Function.</p>
  
  <p>Below is my swift function.</p>
  
  <pre><code>  @IBAction func enviarInfo(_ sender: Any) {
            let request = NSMutableURLRequest(url: NSURL(string: "http://www.mydomain/index.php")! as URL)
            request.httpMethod = "POST"
  
  
            //The String with the vars that will be sent to the $_POST["var"]
            let postString = "nombre = \(nombreText.text!) &amp;aPaterno = \(apaternoText.text!) &amp;aMaterno = \(amaternoText.text!) &amp;genero = \(genero.text!) &amp;email = \(emailText.text!) &amp;telefono = \(telefonoText.text!)"
  
  
            request.httpBody = postString.data(using: String.Encoding.utf8)
  
            let task = URLSession.shared.dataTask(with: request as URLRequest) {
            data, response, error in
  
            if error != nil {
              print("error=\(String(describing: error))")
              return
              }
  
            print("response = \(String(describing: response))")
  
            let responseString = NSString(data: data!, encoding: String.Encoding.utf8.rawValue)
            print("responseString = \(String(describing: responseString))")
            }
        task.resume()     
      }
  </code></pre>
  
  <p>The PHP code looks like this</p>
  
  <pre><code>  $nombre = $_POST["nombre"];
    //All the $vars look like this.
  
       echo $nombre;
  </code></pre>
  
  <p>I would appreciate your help :)</p>