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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Send Info from Applet to CGI Script ??

Status
Not open for further replies.

Metal2You

Programmer
Feb 19, 2002
2
US
I want to compare a score from a game in an applet in the user's browser to the scores that are in a text file on my server. I imagine the easiest way to do this is to pass the info to a CGI scipt (will be in perl) and have the perl script do the file work. Would this be easier than having the applet do the file work remotely or passing the variables directly to the script (with use of java.pm?) ?

If someone could point me in the right direction as to where I can learn how to call a cgi script from a Java applet, or post some source code if its easy enough, I would gretly appreciarte the help. Thanks in advance.
 
Okay, thats what I thought would be the easiest way. How would I actually do that though?
 
You redirect to the url.
applet.showDocument(URL);

If you want the user to stay on the same page then you
have to do it independent of the browser. The applet
can open a connection back to the machine where it
came from ONLY so the cgi script must live on the same
machine that the applet does. Then you will be able
to open a url connection to the script address and
retrieve the data without the browser leaving the
game page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top