Reply to Re: simple php queston

Your name:

Reply:


Posted by Tyno Gendo on 06/08/07 15:50

Iván Sánchez Ortega wrote:
> Mark Winter wrote:
>
>> <SELECT MULTIPLE name="CATEGORIES" size="10" id="CATEGORIES"
> [...]
>> $categories=htmlspecialchars($_POST['CATEGORIES']);
>
> You need to turn that into an array. Keep in mind that a <select multiple>
> returns several GET or POST variables with the same name. So, you'll have
> to use the magic of the [] operator here:
>
> <select multiple='multiple' name='categories[]' ... >
>
> And then, something like:
>
> foreach($_POST['categories'] as $cat)
> {
> echo $cat;
> }
>

if you just want to get the entries as a string to store in the database
and don't want to display them straight away, you could do the following
and not have to recurse through the array:

$categories = (string)@implode(",", $_POST['categories']));

[Back to original 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

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