Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java and php

Status
Not open for further replies.

IDTstudios1

Programmer
Aug 8, 2004
72
US
what would be the best way for a java app to communicate with a php script? is there anyway this can be done.

Thanks,
Andrew
 
The only way I can think of is passing information like so:

script.php?action=whatever

and then read the output.
 
How are you calling the Java app from within the script?
Do you exec() with JRE?
 
the java app resides on the client computer and the php script on the server. The level of communication will be fairly simple. I was thinking of having the Java app just call the php script and download it as if it were a text file and whatever the out put would be the response. I'm probably not making much sense of this, but i'm just trying to figure out what my options are.
 
Here's what I think:
The way of communication from the Java on the client depends entirely how you implement it in the app.
In any case you'll have to make a request to the server, along with POST data, or as you suggested just a GET request.
You could of course implement any other protocol, such as SOAP and have the PHP script act as a SOAP server.
The client side applet will have to establish a connection and talk to the PHP script that way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top