0

I am having a php script and I want to send parameters to it. In android I successfully use that code:

Can you help me with the equivalent code in Obj-C?

 nameValuePairs.add(new BasicNameValuePair("table", table));
         nameValuePairs.add(new BasicNameValuePair("code", Integer.toString(code)));
         nameValuePairs.add(new BasicNameValuePair("name", temp_name));
         nameValuePairs.add(new BasicNameValuePair("email", email));

I know how to fetch data from php or call a http script, I just don't know hot to send these paramterers to php.

In php side my code is this:

$table.=$_POST['table'];
$code.=$_POST['code'];
$name.=$_POST['name'];
$email.=$_POST['email'];

1 Answer 1

1

The proof is in the pudding: iOS: how to perform a HTTP POST request?

I would suggest though, that you use a NSDictionary object to hold your values and JSON encode. Take the JSON data and submit it to the server. Use JSON decode within your PHP script to decode and work the results.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.