View Single Post
Old Jul 4th, 2006, 5:31 PM   #19
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
the Java Applet is the game itself which takes care the game and sending info to a web page "action.php". Javascript isn't an option, unfortunately.

The method I would have to use is the "post" method. "Figure A.1" is the html page that would normaly send the score. However, instead of telling the user to "go to this website and enter your score", I want to do it for them. Thus, my java applet must do this. Interacting with the PHP program (on the server) shouldn't be a problem. All I have to do is basically send the score data to the site.

You guys are telling me to send the info to the url. Well the url is similar to "http://m-net.arbornet.org/~eric/action.php" and I'm not sure exactly what I'm supposed to do with the url once I've formed it. So far, I use the url class to form the url with
import java.applet.*;
import java.awt.*;
import java.io.*;
import java.net.*;
...
url = new URL ("http://m-net.arbornet.org/~eric/action.php");
// String score = 1012345";
However, once this is done I don't know what method to use to send the score to the url
Any ideas?


Figure A.1
<html>
<body>
<form action ="action.php" method="post">
<p>Your name: <input type="text" name="strname"/></p>
<input type="submit"/>
</body>
</html>
__________________
Death smiles at us all. All a man can do is smile back.
Eric the Red is offline   Reply With Quote