Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to validate Username and password with Webserver values in I phone application
    primarykey
    data
    text
    <p>I am developing view based application.I have login page when we click on Login button it should check entered values with webserver values and it should display vali or invalid.I have wriiten code in this way it is executing successfully i am getting the result in this way</p> <pre><code> &lt;!DOCTYPE html PUbLIC" -//W3C//DTD XHTML 1.0 Strict.... </code></pre> <p>What i need to change in below code to comapre with server values..can any one help me regarding this please...</p> <pre><code>-(IBAction)buttonClick:(id)sender { NSString* username = nameInput.text; NSString* pass = passInput.text; if([nameInput.text isEqualToString:@"" ]|| [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:@"https://108.16.210.28/Account/LogOn"]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; [theRequest setHTTPMethod:@"POST"]; [theRequest setValue:postLength forHTTPHeaderField:@"Content-Length"]; [theRequest setHTTPBody:postData]; [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[url host]]; NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; if( theConnection ) { webData = [[NSMutableData data] retain]; } else { } [nameInput resignFirstResponder]; [passInput resignFirstResponder]; nameInput.text = nil; passInput.text = nil; } -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { [webData setLength: 0]; } -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [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]; } - (void)dealloc { [super dealloc]; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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