I am having trouble, when I try using multiple parameters, such as this:
CMD=lol&val=Jesus
The webserver tries to treat "CMD" as containing "lol&val=Jesus". Any help?
By the title - "HTTPObject - multiple GET parameters" - I assume that you want to use get data, however get data is passed to the server entirely encoded in the url that you request.
Post data seems similar to what you are describing.
To prove my point, I created two examples, the first, using get data, the second, using post data:
The first example's html form.
<html>
<body>
<form name="input" action="http://127.0.0.1/doesNotExist.php" method="get">
<input type="text" name="var1" value="asdf1" />
<input type="text" name="var2" value="asdf2" />
<input type="submit" />
</form>
</body>
<html>
The first examples's http header. (With the user agent foobared.)
GET /doesNotExist.php?var1=asdf1&var2=asdf2 HTTP/1.1
Host: 127.0.0.1
User-Agent: foo
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
The second example's html form. (Same as the first one but using POST instead of GET as a method of sending data to the server.)
<html>
<body>
<form name="input" action="http://127.0.0.1/doesNotExist.php" method="post">
<input type="text" name="var1" value="asdf1" />
<input type="text" name="var2" value="asdf2" />
<input type="submit" />
</form>
</body>
<html>
The second examples's http header. (With the user agent foobared.)
POST /doesNotExist.php HTTP/1.1
Host: 127.0.0.1
User-Agent: foo
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 21
var1=asdf1&var2=asdf2
I think you might be under the impression that you need to use "CMD=" because I think I remember from when I read it that RTB2 (and possibly 3, I still have yet to read it) uses "c" as one of (or rather, their first) variable that is passed. This variable represents a command, and in the scripts, is usually referred to as "%cmd".
Here is an example of a header sent by RTB
2 with the a few values (that are useless to a reader anyway) foobared.
POST /blockland/rtbClientAuth.php HTTP/1.1
Host: 127.0.0.1
User-Agent: Torque/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 160
c=AUTH&n=bob%26rob&arg1=Not%20on%20a%20Server&arg2=foo&arg3=2.03&arg4=foo&arg5=&arg6=&arg7=&arg8=&arg9=&arg10=&PHPSESSID=foo
I also push the case that your tcpObject::get() method may be the problem because in a default install of BL, there is no such method, look at this log excerpt from a fresh install of BL made just for this purpose.
==>new tcpObject(doIHaveAGetMethod);
==>doIHaveAGetMethod.dump();
Member Fields:
Tagged Fields:
Methods:
connect() - (string addr)Connect to the given address.
delete() - obj.delete()
disconnect() - Disconnect from whatever we're connected to, if anything.
dump() - obj.dump()
getClassName() - obj.getClassName()
getGroup() - obj.getGroup()
getId() - obj.getId()
getName() - obj.getName()
getType() - obj.getType()
listen() - (int port)Start listening on the specified ports for connections.
save() - obj.save(fileName, <selectedOnly>)
saveBufferToFile() - (string filename)Save the data recieved since isBinary(true) to a file.
schedule() - object.schedule(time, command, <arg1...argN>);
send() - (...)Parameters are transmitted as strings, one at a time.
setBinary() - (bool true/false)Starts to accumulate recived data into a buffer. This can be saved with saveBufferToFile
setBinarySize() - (int filesize)Starts to accumulate recived data into a buffer and initialises an array of size filesize.
-NEWLINE SO AS NOT TO STRETCH THE FORUM PAGE- This can be saved with saveBufferToFile
setName() - obj.setName(newName)
Warning - while you were typing a new reply has been posted. You may wish to review your post.