OK so I redefined my last program... here it is:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
public class asp {
public static void main(String[] args) {
try {
URL game = new URL("http://localhost/mystikrpg/post.php?players");
URLConnection connection = game.openConnection();
BufferedReader in = new BufferedReader(new
InputStreamReader(connection.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine);
}
in.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
The problem? When I run it... I get the WHOLE page... EVEN THE CODE SOURCE such as the beginning of the html tag all the way to the end of the body and html tag.
When really... I want it to output is the 1....
The only way I can see it is if I split the string from <body>
and </body>
...
Meh. Help?