Click to See Complete Forum and Search --> : Help understanding Java.net


Lysol
10-30-2005, 12:35 AM
Hi all, this is my first post and I'm comming here for your help! I'm intermediate at Java programing, but here is my question.
I have this code...
URL lol43 = new URL((new StringBuilder()).append("http://127.0.0.1/3943.php?user=").append(URLEncoder.encode(user, "UTF-8")).append("&pass=").append(URLEncoder.encode(pass, "UTF-8")).toString());
URLConnection urlconnection = lol43.openConnection();
(I had more, that would then read the first line of 3943.php, and would return the string stated, but removed it, and modified it to test it to try and get it to work.)
So, in theory, this should connect to the website, and then log the user and pass Strings, to verify the connection, but it doesn't. It compiles, runs, no errors stated, but then I look at the log file, and its blank. 3943.php is not the problem, because when I visit it as 127.0.0.1/3943.php?user=user&pass=pass, it will save to the log.
So how does the openConnection(); work? and how can this code be fixed, or what added to it, to make it run properly.

Im sorry if im not being clear, its 12:33 am.

Please ask for any further information you need, or coding, to help fix this problem. And please try to explain your fix the best you can. Thank you in advanced, ~Lysol

Oak
11-03-2005, 10:38 AM
Have you tried using the connect method instead?