简体   繁体   中英

Bridge between PHP site and Java applet

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?

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.

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.

即使您打算使用HTTP发送和接收数据,也无法确保它,因为用户始终可以访问它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM