title: updating text from a label.text to the server and saving it in a text file
body: <p>i am trying to upload label.text on a server within a text file on the server here is my code. it isnt showing any error but file created on server but no text in it. please help.</p>
  
  <pre><code>NSString *post =[[NSString alloc] initWithFormat:@"VIN: %@",vincode.text];
          NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding
                                allowLossyConversion:NO];
          NSString *postLength = [NSString stringWithFormat:@"%d", [postData
                                                                    length]];
          NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init]
                                          autorelease];
          [request setURL:[NSURL URLWithString:@"Server Detail Here/upload_vin.php"]]; 
          [request setHTTPMethod:@"POST"];
          [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
          [request setValue:@"application/x-www-form-urlencoded"
         forHTTPHeaderField:@"Content-Type"];
          [request setHTTPBody:postData];
          NSData *urlData = [NSURLConnection sendSynchronousRequest:request
                                                  returningResponse:nil error:nil];
          NSLog(@"Succeeded! Received %d bytes of data",[urlData length]);
          NSLog(@"VIN is %@",vincode.text);
          NSString *outputdata = [[NSString alloc] initWithData:urlData
                                                       encoding:NSASCIIStringEncoding];
          NSLog(@"Outputdata is %@",outputdata);
          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!");
  PHP file::::::::::::::
      &lt;?php
      $file = "VinCodes.txt";
      #$submitted_vincode = $_GET['VIN'] . " \n";
      $submitted_vincode = @$_POST['VIN'] . " \n";
      if(!empty($submitted_vincode)){
      $Handle = fopen($file, 'a');
          fwrite($Handle, $submitted_vincode); 
          print "Vin Code stored in file."; 
          fclose($Handle);
      }else{
          print "Vin code is missing. Try again";
      }
      ?&gt;
  </code></pre>