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
  • 32,227
  • 27
  • 88
  • 117
James P.
  • 19,313
  • 27
  • 97
  • 155

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
  • 81,495
  • 25
  • 153
  • 204
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
  • 42,059
  • 16
  • 116
  • 175
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
  • 8,199
  • 9
  • 50
  • 66