Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all articles
Browse latest Browse all 884

Using URLEncode to upload data via PHP to mYSQL (no replies)

$
0
0
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 !?!

Viewing all articles
Browse latest Browse all 884

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>