[wp-hackers] Sending checkbox parameters to a non-PHP script using wp_remote_post
Mike Walsh
mpwalsh8 at gmail.com
Sat Jan 28 12:04:58 UTC 2012
I am using wp_remote_post() to submit some data to a Google form and have
run into an issue I am not sure how to address. I think the crux of the
problem is how PHP and Python deal with named parameters for checkbox
inputs. In PHP if I have a group of checkboxes with the name "icecream" I
will only the get one value passed and it will be the last of the
checkboxes checked so instead of "icecream" I would use "icecream[]" to
name the input and I'll be able to process all of the selections. Pretty
standard stuff.
On a Google Form all of the checkboxes in a group have the same name but
they don't have the array syntax. On the Google side (which to the best of
my knowledge is powered by Python) it somehow manages to process these
inputs which all have the same name correctly. Looking at some Python
examples it appears that there is a language construct to extract multiple
values from what appears to be a single named input.
My question is this - what does the HTTP request look like and can I mimic
it with wp_remote_post()? I am not sure how to take the values for my PHP
array "icecream[]" and configure the parameters for wp_remote_post() so all
the checked values will be sent to Google which is expecting a parameter
called "icecream".
Thanks.
--
Mike Walsh - mpwalsh8 at gmail.com
More information about the wp-hackers
mailing list