By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,046 Members | 1,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,046 IT Pros & Developers. It's quick & easy.

Multiple List with PHP

P: 2
Hello I need some help here...

I have a dropdown list working perfect, but the problem is that I need it multiple selection, so when I change the name for name(), and the type for multiple posting with POST

I thought it could be something like

[PHP]echo"variable name[0]";
echo"variable name[1]";[/PHP]


does any of you know how to do it?
Feb 7 '07 #1
Share this Question
Share on Google+
2 Replies


P: 99
if i understand you have a list like
[HTML]
<select name="multiple[]" size="5">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
[/HTML]

notice the [] in the name. This is the way to define an array for php

[PHP]print_r(multiple);[/PHP]

If you do this when you post it form you will see an array with multiple values if you selected multiple options.

i hope this is what you where looking for
Feb 8 '07 #2

Motoma
Expert 2.5K+
P: 3,235
Thanks xwero!!
Feb 9 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.