Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-24-2010, 03:52 AM   #6 (permalink)
Johanovski
Divine avenger
 
Johanovski's Avatar
 
Join Date: Nov 2009
Location: Vic, Catalunya (Spain)
Posts: 320
Johanovski is on a distinguished road
Default

Hi there!

I'm working in an application that uses .php files stored in a server. In the iPhone app user have to enter it's username and password, then send it to the server (without using Safari) and then the server returns some information in .xml format (which is received and stored by the app). This is how username and password are sent:

Code:
// check if textFields aren't empty
if (![self.txtName.text isEqualToString:@""] && ![self.txtPass.text isEqualToString:@""]) {
		NSURL *url = [[NSURL alloc] initWithString:[NSString stringWithFormat:@"http://www.yourweb.com/yourfile.php?user=%@&pass=%@",self.txtName.text,self.txtPass.text]];
		
		NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
		
		NSData *urlData;
		NSURLResponse *response;
		urlData = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:nil];
                // urlData receives the returned information and then you can process
                // it by storing in a temporary file and working with NSStrings
Hope it helped!
Johanovski is offline   Reply With Quote
 

» Advertisements
» Online Users: 495
20 members and 475 guests
baja_yu, Chickenrig, David-T, dre, eski, Gaz, gbenna, givensur, headkaze, JoeRCruso, LunarMoon, Mp808, poke, RickSDK, sacha1996, smithdale87, spiderguy84, toolifog, vbovio, wandou
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,548
Threads: 94,074
Posts: 402,710
Top Poster: BrianSlick (7,990)
Welcome to our newest member, mrtdmb
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:18 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.