mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2004
Posts: 11
A
Pikka bird
OP Offline
Pikka bird
A
Joined: Apr 2004
Posts: 11
I wrote a script that can get infomation from my web site, and i want to submit a form to tranfer data to my site using method POST (like : login a forum with username and password)...
Can you help me?

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
See if this post helps. If not, you can make an expanded search over the board.

Joined: May 2003
Posts: 79
A
Babel fish
Offline
Babel fish
A
Joined: May 2003
Posts: 79
If you speak French, I've written a tutorial on how to use cookies with mIRC scripting. The tutorial shows you how to login to scriptsdb.org while explaining the process. You can read it here.

Joined: Oct 2003
Posts: 101
Vogon poet
Offline
Vogon poet
Joined: Oct 2003
Posts: 101
Sorry this is gonna paste so ugly. I really don't like $& though.

Code:
alias httpreq {
  var %p | if ($1 == -p) { %p = 1 | tokenize 32 $2- }
  sockwrite -n $1 $iif(%p == 1,POST,GET) $3 HTTP/1.1 $+ $crlf $+ Accept: */* $+ $crlf $+ User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) $+ $crlf $+ Host: $2 $+ $crlf $+ Connection: Keep-Alive $+ $iif($4,$crlf $+ Referer: $4) $+ $iif($5,$crlf $+ Cookie: $5) $+ $iif($6,$+($crlf,Content-Type: application/x-www-form-urlencoded,$crlf,Content-Length: $len($5),$crlf,$6))
  if (%p == $null) { sockwrite -n $1 }
}


The usage is as follows:

/httpreq [-p] <sockname> <host.com> </url.html> [referral-site] [cookie-data]

- Default uses http GET.
- The optional -p is the POST you want.
- Right now it only supports one cookie (name=value;). Maybe someone can improve upon it?




#79140 16/04/04 03:08 PM
Joined: Apr 2004
Posts: 11
A
Pikka bird
OP Offline
Pikka bird
A
Joined: Apr 2004
Posts: 11
I will test your script and hope that it run ok. Thanks for your teaching.

Joined: Apr 2004
Posts: 11
A
Pikka bird
OP Offline
Pikka bird
A
Joined: Apr 2004
Posts: 11
I think you can write a script that can register a username for Invision Power Board (IBF). If you have a correct code can you share me? I'm learning about socket with sending data by POST method, but I have not a good sample... Thanks a lot for helping me.

Joined: Oct 2003
Posts: 101
Vogon poet
Offline
Vogon poet
Joined: Oct 2003
Posts: 101
I just noticed a bug in that code. The $len should be $len($6) not $len($5). Sorry


Link Copied to Clipboard