curl-library
Re: PHP style postfields with []
Date: Tue, 29 Oct 2002 01:41:08 +0100 (MET)
On Mon, 28 Oct 2002, charles wrote:
> Hello,
> Im trying to write a stats collector that collects stats from various
> websites. For one of them they have this (edited for room)
>
> <input type=checkbox name="stat[]" value="raw" checked>
> <input type=checkbox name="stat[]" value="uniq" checked>
> <input type=checkbox name="stat[]" value="join" checked>
>
> and so forth, if i wanted to check more than to have raw and uniq checked, how would i send this in the post fields, i have tried
>
> parms = "stat[]=raw&stat[]=uniq";
>
> and
>
> parms = "stat=raw";
>
> but it doesnt appear to be working, any thoughts ?
It's all reeeeeally simple:
1. Save the HTML
2. replace the POST with a GET.
3. Make a submit with your browser.
4. Read the URL.
5. Copy the part to the right of the ? and use that.
With all the three above boxes checked, it makes this:
stat%5B%5D=raw&stat%5B%5D=uniq&stat%5B%5D=join
-- Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sfReceived on 2002-10-29