Posting a Hash?
Chris Martino (chris@console.org)
Wed, 11 Apr 2001 13:20:53 -0400 (EDT)
Hi-
I'm currently running a script which takes input from a text file, splits
it into 7 fields, then submits it to a form. Code below:
while (<FILE>) {
($f1, $f2, $f3, $f4, $f5, $f6, $f7) = split("\t", $_, 9999);
$request = new HTTP::Request('POST', "http://app1.int2.fatshoe.com:7001/rebates");
$request->content_type('application/x-www-form-urlencoded');
$request->content("r0_f0=$f1&r0_f1=$f2&r0_f2=$f3&r0_f3=$f4&r0_f4=$f5&r0_f5=$f6&r0_f6=$f7");
$response = $ua->request( $request );
}
Now, this all works fine, but the form can handle several posts at once.
Notice the r0_f0, r0_f1, r0_f2, etc. Now the form can handle an infinate
ammount of rows. For example, if I have 300 rows to process, the 300th
row can be r300_f0, r300_f1, etc.
Currently everything is being submitted one at a time with just r0_f*.
Is there any way I can submit all the data in one clean sweep with one
form post?
TIA,
Chris