title: How do i sign into a website using username/password from XCode?
body: <p>I'm pretty much new into Objective-c programing , and my knowledge of PHP is almost nothing.
  Anyway, I'm trying to do a login screen in my App which has 2 text fields for username and password, and a button which suppose to enter the username/password into a website sign in page , and connect to the account.
  I'm not sure if I'm on the right way but here is a sample of the code i made:</p>
  
  <pre><code>-(IBAction)ButtonClicked:(id)sender
  {
      NSString *content = @"username=blabla&amp;password=123456";
      NSData *data=[content dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
      NSString *postlenght=[NSString stringWithFormat:@"%d",[data length]];
  
      NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://roadster.co.il/forums/ucp.php?mode=login"]];
      [request setHTTPMethod:@"POST"];
      [request setValue:postlenght forHTTPHeaderField:@"Content-Length"];
      [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Length"];
      [request setHTTPBody:data];
      NSError *error=nil;
      NSURLResponse *response=nil;
      NSData *result=[NSURLConnection sendSynchronousRequest:request returningResponse:&amp;response error:&amp;error];
  
      [webview loadRequest:request];
  }
  </code></pre>
  
  <p>As you can see the website I'm trying to log into is 
  <a href="http://roadster.co.il/forums/ucp.php?mode=login" rel="nofollow">http://roadster.co.il/forums/ucp.php?mode=login</a>
  I'm sorry but the website is in Hebrew but it not the matter. can you please tell me why i don't manage to sign in using this code? (tried with the real password/username)</p>