Using URLEncode to upload data via PHP to mYSQL
Posted by: Arthur Chan
Date: September 04, 2018 01:31AM

This time around, I am uploading data from the client Java app via PHP to mySQL server. On the PHP end, I am using a _POST and in Java I am using URLEncoder.encode, like this:



ArrayList<String> urlVar = new ArrayList<>();

urlVar.add("?" + (URLEncoder.encode("coyName","UTF-8")+ "=" + URLEncoder.encode(coyName, "UTF-8")));

I am trying to figure out why the above would work, but this won't work (which is what I have been doing).
urlVar.add((URLEncoder.encode("?coyName","UTF-8")+ "=" + URLEncoder.encode(coyName, "UTF-8")));

Moving the ? out of the encode() makes all the difference !?!

Options: ReplyQuote


Subject
Written By
Posted
Using URLEncode to upload data via PHP to mYSQL
September 04, 2018 01:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.