PHP & Multiple Select Form(s)

software development


Hello -

I’m having a problem when posting a multiple select form to a php script on one of my dreamhost accounts…


Here’s the script it’s posting to:

<?php print_r($_POST); ?>

One would expect to see an array returned in the $_POST variable if you selected multiple options in the select input. However, under all circumstances I do not see the result that is to be expected.

I’m assuming this is an apache setting somewhere, but wanted to run it by everyone incase I’m missing something obvious.

Thanks for the help.


You’re missing something obvious - PHP documentation. That is how PHP works. Don’t forget it is the PHP engine that is reading the standard input to get the form data - not Apache. The PHP developers decided that you have to jack with the HTML to tell PHP you expect multiple values. Only when you name the field “testSelect[]” will it make an array for you.

:cool: -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7


d’oh… Thanks :slight_smile: