On Fri, 19 Mar 2004 13:17:32 +0000 (UTC), "James" <nospamheredude@yahoo.com>
wrote:
[color=blue]
>I am trying to set up a PHP file that receives data from an applet via
>Java's URL object (this sends a URL so I can place PHP attributes in this),
>gets a set of numbers from a database table and sends them back to the
>applet.
>
>The part I am unsure of is how to send data back to applet. The applet will
>be able to read information back in but I can't find any information on how
>to send information out from a PHP file. Obviously there is 'echo' but I am
>not sure if it can be used in this situation.[/color]
I think that's exactly what you want, if I'm understanding your requirements.
[color=blue]
>Here is an example of the DB table to clarify the type of data being output
>by the PHP script:
>
>Table data:
>
>name data(of type number)
>donnie 3
>donnie 1
>frank 2
>donnie 4
>
>and I will simply extract data with an SQL statement such as SELECT * FROM
>data where name = 'donnie';[/color]
Just echo out the information from PHP in whatever format the Java applet
wants. Then in Java use java.net.URL.openStream to get an InputStream, and read
and parse the data.
--
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk /
http://www.andyhsoftware.co.uk/space