You are here: Re: array in $_GET ... « PHP Programming Language « IT news, forums, messages
Re: array in $_GET ...

Posted by Kimmo Laine on 12/18/70 11:50

"dude" <dude.j@gmail.com> wrote in message
news:e6u5nn$3g3$1@ss408.t-com.hr...
> i'll try to be short ... i have this in html :
>
> <select name="OS[]" size="5">
> <option value="0" selected>Please select one or more...</option>
> <option value="1">Windows</option>
> <option value="2">Mac OS X</option>
> <option value="3">Linux</option>
> </select>
>
> and i want to echo the values from this simple list (OS), i mean array
> from $_GET array ...
>
> i did this:
>
> foreach($_GET as $i => $val)
> echo $i . ": " . $val . "<br>";


try:
foreach($_GET['OS'] as $i => $val)
echo $i . ": " . $val . "<br>";

By the way, I think you're missing the attribute MULTIPLE from the select if
you want to be able to select multiple items. It should be
<select name="OS[]" size="5" multiple>

or if you're using xhtml,
<select name="OS[]" size="5" multiple="multiple">



--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация