I have a java applet trying to pass some GET data to a php file in the same directory as my applet. When I start a url connection to the file.php and pass the data, I don’t get anything, however when I append the full URL in front of the PHP file, it works.
Here’s what I have:
URL sp = new URL ("file.php?data1=" + data1 + "&data2=" + data2 + "&data3=" + data3);
BufferedReader in = new BufferedReader(new InputStreamReader(sp.openStream()));
But, the data only gets passed if i add my full http://www.website.com/ url in front of file.php
EDIT:
It works now, with a URL test = new URL(getCodeBase(), “form.php”);
Given documents located:
– http://www.website.com/docs/applet.html (document base)
– http://www.website.com/forms/form.php (target form)
server (http://www.website.com/)
An URL to
form.phpcan be created using either of..