As the title says … I have tried to use the following code to execute a PHP script when user clicks a button in my Java Swing application :
URL url = new URL( "http://www.mywebsite.com/my_script.php" );
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.connect();
But nothing happens … Is there something wrong ?
I think you’re missing the next step which is something like:
HttpURLConnectionbasically only opens the socket onconnectin order to do something you need to do something like callinggetInputStream()or better stillgetResponseCode()