I have a method which takes a very long string, 90,860 characters and passes this to a PHP page which is then inserted into a database. I've read that there isn't a limit on the size of a PHP post upto about 8mb. I'm assuming that this length of string should be ok.
msg = URLEncoder.encode(stringToEncode.toString(),"UTF-8");
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("http://mysite.com/insert.php?data="+msg);
HttpResponse response1 = httpclient.execute(httpPost);
I know that this works as I can insert short plain strings.
On my PHP page I just get the post data like:
$data = $_GET['data'];
And insert it. Do I need to add some extra php to de-code the post message? I read that it should be done automatically by PHP.
The problem is that with the long string I either get a 500 error or if I take the string and put it in my browser I just get a page not available.
Thanks in advance!