I’m working on an app that asks the user to login to access some of his infrmations. I have a login.php file that is store on the server and all the usernames and passwords on the database.
On my app i have 2 uitextfields one for the username and one for the password. I understand that i can use the POST method to pass on the input to the web server and check wether the username and password match to then load the rest of the data. This is where am having trouble, can anyone help me with it, how do i pass on the inputs from the uitextfield to that web service to run the long.php script?
Skram’s answer is correct, although you might be thinking what is ASIHTTPRequest?
You can get the framework here:
ASIHTTPrequest home
Here is a short beautiful tutorial on how to use it:
Awesome Tutorial
And here is some code I used to do a login some time ago:
Here some more code, this is what happens when the server returns a response.
}
Basically when you start the request using
request startSynchronousit executes you server side code and returns a response string (or fails), you catch and handle the response string (or failure)in a delegate method you must implement from ASIHttpRequest-(void)requestFinished:(ASIHTTPRequest *)request. In the sample code I am parsing the response string into a JSON and then putting it into a dictionary for later use.If you go through the tutorial this will all make sense to you very quickly. Hope it helps, good luck!