0

I want to know if it's possible to have an applet communicate with a PHP site and retrieve some information. If so, what approaches can be used?

mmmmmm
  • 31,464
  • 27
  • 87
  • 113
James P.
  • 18,695
  • 27
  • 92
  • 152

3 Answers3

1

Your applet could do some URLConnections or HTTPConnections and get the raw text returned by the PHP url.

String myUrl = "http://mysite.com/service.php?param1=yay";

Then use the example How do you Programmatically Download a Webpage in Java to get the text.

Community
  • 1
  • 1
corsiKa
  • 79,375
  • 23
  • 153
  • 199
1

Read the PHP page in JAVA Applet, and use JSON/XML format to send data from PHP to Java applet. JSON or XML would make it easier for you to handle the data.

DhruvPathak
  • 40,405
  • 15
  • 109
  • 170
0

Even if you are going to use the HTTP for sending and receiving data, then you can't make it pretty sure, because user has always access to it.

Risto Novik
  • 7,973
  • 9
  • 48
  • 65