I'm trying to sync data from my application onto the server. I'm very new to this kind of work. For this i wrote a small web service in php,
Now, i开发者_JAVA百科'm not able to figure out how to call this web service and how to send the 2 variable values to the insertData function from the app using xCode.
Any kind of help on this would be appreciated.
Thanks & Regards, NR
I would not sync data via php or http in general if i don't have to. I'd use simple things like scp, rsync or, if the data relates to my application some version control, such as git.
However, doing this via php could look something like this:
<!-- server side, lets say the url is http://example.org/sync.php -->
<?php
insert_stuff($_GET["username"], $_GET["password"]);
echo "Inserted.\n";
?>
Locally, i'd use curl:
$ curl "http://example.org/sync.php?username=root&password=root"
Inserted.
...
精彩评论