title: Getting results from PHP after POSTING in Objective-c
body: <p>I'm trying to learn how to use POST and GET stuff with PHP and Objective-c .</p>
  
  <p>I came across a problem., after I make the  POST in objective-c , how do I get the return result?</p>
  
  <p>My PHP file is:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;Bug Reporter&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;h2&gt;Fancy Bug Reporter&lt;/h2&gt;
  &lt;hr /&gt;
  &lt;?php
  if (isset($_POST['go']))
  {
          // Form was posted
          print "User submitted bug: ". $_POST['name'] . ": " . $_POST['description'];
  }
  else
  {
          // Form was not posted, display form
  ?&gt;
  &lt;form method="POST" action="&lt;?php echo $PHP_SELF; ?&gt;"&gt;
  Bug Name:&lt;br /&gt;&lt;input type="text" name="name" maxlength="100" /&gt;&lt;br /&gt;
  Bug Description:&lt;br /&gt;&lt;input type="text" name="description" maxlength="1000" size="80" /&gt;&lt;br /&gt;
  &lt;input type="submit" name="go" value="Add Bug"&gt;
  &lt;/form&gt;
  &lt;?php
  }
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In objective-c :</p>
  
  <pre><code>    NSMutableURLRequest *request =
      [[NSMutableURLRequest alloc] initWithURL:
       [NSURL URLWithString:@"http://xxxxx.com/xxx.php"]];
  
      [request setHTTPMethod:@"POST"];
  
      NSString *postString = @"go=1&amp;name=Bad%20Bad%20Bug&amp;description=This%20bug%20is%20really%20really%20super%20bad.";
  
      [request setValue:[NSString
                         stringWithFormat:@"%d", [postString length]]
     forHTTPHeaderField:@"Content-length"];
  
      [request setHTTPBody:[postString
                            dataUsingEncoding:NSUTF8StringEncoding]];
  
  
      [[NSURLConnection alloc]
       initWithRequest:request delegate:self];
  </code></pre>