Reputation: 172
I am trying to send data to my php script, but I have encoded the URL with my Java application:
final URL url = new URL(base + URLEncoder.encode(params, "UTF-8"));
And this makes the following:
http://www.example.com/send.php?username%3DTest%26runtime%3D15
I use $_GET['username']
and $_GET['runtime']
and when I try to echo those, it prints nothing.
What am I doing wrong?
Upvotes: 1
Views: 83
Reputation: 3496
Your url
should have =
after username
http://www.example.com/send.php?username=%3DTest%26runtime%3D15
And then you can use $_GET['username']
. you have problem with creating url in java, not php.
maybe your java code should be like this
final URL url = new URL(base + "=" + URLEncoder.encode(params, "UTF-8"));
Upvotes: 2