sending variables to PHP scripts

Pages: 123... 6
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
Last edited on
*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
Remember what? I don't recall any conversation with you on the topic of Java.
Where's rapidcoder when you need him? Hmm... maybe he's on the Java forums you're not joining.
Catfish4 wrote:
Where's rapidcoder when you need him? Hmm... maybe he's on the Java forums you're not joining.


This is the only forum that accepted me, after my experience with dream in code... im afraid :(
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.
What are you trying to do, and what is wrong with it?
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
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
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
POST is a type of http message. Try googling around with it.
heres a thing, if i set DoOutput(true) I get an error saying that I havnt :/
what is the error in output?
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
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
@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.
we have kind of decided that posting Java questions in the lounge is ok as it's just the lounge.

Who is 'we'?


We're also not a Boston Marathon Support forum, yet we have a thread discussing that.

That subject doesn't concern a programming language with other forums dedicated to it that would benefit from people posting in them.
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
Pages: 123... 6