All pastes #490999 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-16 11:17 UTC
rendered paste body
I'm have a banner on a php page(https://picard.hgo.se/~siamese/bannergame/bannergame.php), I try to send the the
variable score to the page from the applet, so that the page can echo it.
But the page dosen't receive the variable, what am I doing wrong?

This is how I send:

import java.net.URL;
import java.net.URLConnection;

public class NewApplet extends java.applet.Applet
{
    public void init()
    {
        try
        {
            URL url = new URL("https://picard.hgo.se/~siamese/bannergame/bannergame.php?score=56");
            URLConnection connection = url.openConnection();
            connection.setDoOutput(true);
        }
        catch (Exception e)
        {
            System.out.println("something went wrong");
        }
    }
    
    // TODO overwrite start(), stop() and destroy() methods
}

This is how i receive:

<?php
	if(!empty($_GET[score]))
	{
	        echo "Score: " .$_GET[score];
	}
	else
	{
		echo "no score found ";
	}
?>
<HTML>
<HEAD>
</HEAD>
<BODY>
<P>
<APPLET code="NewApplet.class" width=350 height=200></APPLET>
</P>
</BODY>
</HTML