- Messages
- 5,609
- Reaction score
- 250
- Points
- 63
This should help: http://www.javaworld.com/javatips/jw-javatip34.html
Just replace the perl part with php
Just replace the perl part with php
This should help: http://www.javaworld.com/javatips/jw-javatip34.html
Just replace the perl part with php
A few of the previously linked pages show the details, but you use a URL to get a URLConnection to get an InputStream, which holds the entity body (eg HTML page) sent by the server.For now I will be embedding the pgn data in the HTML. Where else would the java applet get the data from? Until such time that I can master some kind of communication channel from the java client back to the mySQL server, I don't really see any other option. Unless I'm missing something simple?
A few of the previously linked pages show the details, but you use a URL to get a URLConnection to get an InputStream, which holds the entity body (eg HTML page) sent by the server.
As for using HTTP vs <param>, each works in its own way. <param>s mean one less network connection, which means less data transferred because you save on the headers by skipping the second connection. Using HTTP would make it easier to adapt the applet to a standalone app, and would make the means of retrieving and sending game data symmetric.
We do seem to be misunderstanding each other. I was responding to where you said: "For now I will be embedding the pgn data in the HTML. Where else would the java applet get the data from?" The question may have been rhetorical, but it did have an answer:I'm not sure I am making myself clear. I'm not saying I have it right, but the main reason I have thought about http from within java is a means to pass data from java to php, and from php to mySQL. When you start talking about InputStream, I am not sure we are on the same wavelength.
URL gamesURL=new URL('http://chess.example.com/games');
URLConnection gamesConn = gamesURL.openConnection();
InputStream in = gamesConn.getInputStream();