Note that there are some explanatory texts on larger screens.

plurals
  1. POvalidation username and password from server database in iphone
    primarykey
    data
    text
    <p>hi friends i am doing here validation for username and password from server database by given url of server i think i am going wrong i don't think my code is right please some help me how to validation from server database for username and password in iphone</p> <pre><code>-(IBAction)buttonClick:(id)sender { NSString* username = nameInput.text; NSString* pass = passInput.text; if([nameInput.text isEqualToString:@"" ]&amp;&amp; [passInput.text isEqualToString:@""]) { //greeting.text = @"Input Your Value"; //[nameInput resignFirstResponder]; //[passInput resignFirstResponder]; //return; } NSString *post = [[NSString alloc] initWithFormat:@"uname=%@ &amp; pwd=%@",username,pass]; NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]]; NSURL *url = [NSURL URLWithString:@"http://server:85/VirtualTerminal/RecordAttendance.aspx"];//@"https://www.google.com/accounts/ServiceLogin?service=reader&amp;passive=1209600&amp;continue=http://www.google.co.in/reader/?hl%3Den%26tab%3Dwy&amp;followup=http://www.google.co.in/reader/?hl%3Den%26tab%3Dwy&amp;hl=en"]; //@"http://www.chakrainteractive.com/mob/iphone/login/chckusr.php"]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; [theRequest setHTTPMethod:@"POST"]; [theRequest setValue:postLength forHTTPHeaderField:@"Content-Length"]; [theRequest setHTTPBody:postData]; NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; if( theConnection ) { webData = [[NSMutableData data] retain]; //test *t=[[test alloc]initWithNibName:@"test" bundle:nil]; //[self presentModalViewController:t animated:YES]; //[t release]; } else { } //} [nameInput resignFirstResponder]; [passInput resignFirstResponder]; nameInput.text = nil; passInput.text = nil; k [webData appendData:data]; } -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { [connection release]; [webData release]; } -(void)connectionDidFinishLoading:(NSURLConnection *)connection { NSString *loginStatus = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding]; NSLog(@"loginStatus"); greeting.text = loginStatus; [loginStatus release]; [connection release]; [webData release]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload