Apr 21, 2013 at 5:42pm UTC
Am i barking up completley the wrong tree? Im trying to make a "post crap" tool
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
A = URLField.getText();
B = textarea.getText();
C = suffix.getText();
try {
urltpost = new URL (A);
URLConnection con = urltpost.openConnection();
con.setDoOutput(true );
PrintStream piss = new PrintStream(con.getOutputStream());
piss.print();
con.getInputStream();
piss.close();
} catch (MalformedURLException e) {
URLField.setText("Muppet:" + e.toString());
} catch (IOException e) {
URLField.setText("Muppet: " + e.toString());
}
Last edited on Apr 26, 2013 at 1:58pm UTC
Apr 21, 2013 at 5:48pm UTC
Last edited on Apr 21, 2013 at 5:53pm UTC
Apr 21, 2013 at 5:58pm UTC
*sigh* we HAVE had a conversaton about this a while back, maybe you are an entirley new catfish and that is why you don't remember
Last edited on Apr 21, 2013 at 5:59pm UTC
Apr 21, 2013 at 6:09pm UTC
Remember what? I don't recall any conversation with you on the topic of Java.
Apr 21, 2013 at 6:24pm UTC
Where's rapidcoder when you need him? Hmm... maybe he's on the Java forums you're not joining.
Apr 21, 2013 at 6:43pm UTC
This is a C++ forum, and is not where Java questions belong .
Go to a Java forum already.
Or if you're stubborn, wait until LB, or rapidcoder, or another Java person shows up and maybe help you.
Apr 21, 2013 at 7:41pm UTC
What are you trying to do, and what is wrong with it?
Apr 21, 2013 at 7:57pm UTC
I am trying to post form data, ie
username = "user" password = "password"
I didnt know it was called posting form data at the time i just thought you wrote to the page, its for this...
http://www.hackthis.co.uk/levels/i2.php
since i made that break through i might be okay, I should be learning PHP a bit better before I bother you guys (specially catfish :P (sry catfish))
Last edited on Apr 21, 2013 at 7:58pm UTC
Apr 21, 2013 at 8:00pm UTC
I get a please register, could you take a printScreen of the image, or is it unimportant? So where is your code wrong?
Last edited on Apr 21, 2013 at 8:00pm UTC
Apr 21, 2013 at 8:12pm UTC
Oh yeah sry bout that, I forgot you have to register, basicaly I have to Post the word "flubergump" to the page to pass the coding challenge, I have to send the POST data whatever that might be,
If that code I originaly posted does send to the page, could I just send data in the form of a form?
maybe 0.49 of this you tube video will show you what im getting at will show you what I have to post,
http://www.youtube.com/watch?v=8tmTZVcT_7k
Last edited on Apr 21, 2013 at 8:13pm UTC
Apr 21, 2013 at 8:13pm UTC
POST is a type of http message. Try googling around with it.
Apr 21, 2013 at 8:51pm UTC
heres a thing, if i set DoOutput(true) I get an error saying that I havnt :/
Apr 21, 2013 at 9:04pm UTC
what is the error in output?
Apr 21, 2013 at 9:10pm UTC
The thing is I have set it to true!! it just doesnt want to think I have :/
java.net.ProtocolException: cannot write to a URLConnection if doOutput=false - call setDoOutput(true )
I think java is the devil, I just use it to know how things work so I can do it all again with the finesse c++ has to offer
Last edited on Apr 21, 2013 at 9:11pm UTC
Apr 21, 2013 at 10:22pm UTC
you have to set do output as true before you open the data stream
Still dont know what to post in what form though
Last edited on Apr 21, 2013 at 10:23pm UTC
Apr 22, 2013 at 3:37pm UTC
@Catfish, we have kind of decided that posting Java questions in the lounge is ok as it's just the lounge. It's meant for whatever. We're also not a Boston Marathon Support forum, yet we have a thread discussing that.
Apr 22, 2013 at 4:31pm UTC
If everyone wants to get
really technical it is not allowed:
http://www.cplusplus.com/forum/lounge/6/#msg6
admin wrote:In this forum, users can to talk about topics other than programming
EDIT: But I still see no harm in it. The lounge is generally accepted as a place where non-C++ topics go, so just leave devon be.
Last edited on Apr 22, 2013 at 4:32pm UTC