1

I am about to develop an application for the iOS devices, that will need to store information in a database on the web. For previous projects, i would just have PHP scripts, and my application would run those scripts and passing in the stuff to upload as _GET parameters, like this:

http://example.com?name=George&contents=iWillBePutIntoDB

However, this is not possible for my next project, as it will contain rather large amount of text, and i could exceed the maximum allowed length of a URL.

So, how do i go about doing this? I cannot access the MySQL database directly from my app, since my shared hosting provider doesn't allow it due to security reasons. So i can only access it using PHP scripts that are stored directly on the server.

In short: How do i upload large amount of text to a MySQL database that doesn't allow access from anywhere except files on the server itself (PHP scripts)?

Thanks everyone!

J.B.J.
  • 440
  • 1
  • 8
  • 15

1 Answers1

0

One obvious way would be using POST, instead of using GET.

But take it into your considerations that post is not without its limits.

Community
  • 1
  • 1
sampathsris
  • 21,564
  • 12
  • 71
  • 98
  • How would i be able to do this from Xcode? Using get i would just put it in the URL http://example.com?lala=tada but i don't think POST works the same way? – J.B.J. Jul 13 '14 at 17:08
  • How do you already create get requests? There should probably be a functionality symmetric to that. – sampathsris Jul 13 '14 at 17:11
  • Not really, but i discovered i had to use NSURLConnection to make it! Thanks guys. I honestly didn't think POST requests were possible outside of the PHP script. Another thing learned today :) – J.B.J. Jul 13 '14 at 17:15