unable to get data from iphone application
<p>I have made a php web services that takes the username and password from iPhone application and saves the data in the users table.</p>

<p>I call that web service from my button touchup event like this:</p>

<pre><code> NSLog(userName.text);
 NSLog(password.text);

 NSString * dataTOB=[userName.text stringByAppendingString:password.text];

 NSLog(dataTOB);

 NSData * postData=[dataTOB dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];

 NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];

 NSLog(postLength);

 NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];

 NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://localhost:8888/write.php"]];

 [request setURL:url];
 [request setHTTPMethod:@"POST"];
 [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
 [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
 [request setHTTPBody:postData];

 NSURLResponse *response;
 NSError *error;

 [NSURLConnection sendSynchronousRequest:request returningResponse:&amp;response error:&amp;error];

 if(error==nil)    
   NSLog(@"Error is nil");   
 else
   NSLog(@"Error is not nil");
 NSLog(@"success!");
</code></pre>

<p>I am getting nothing from Iphone side into the web service and I am unable to understand why this is happening. Although i debugged and found that everything is fine at the iphone application level but the call to the web service doesn't works as expected......</p>

<p>Please suggest.....</p>

<p>Thanks
Ashish</p>
