You are here: Re: simple php queston « PHP Programming Language « IT news, forums, messages
Re: simple php queston

Posted by Jerry Stuckle on 06/08/07 18:50

Tyno Gendo wrote:
> 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']));
>

That would be against normalization techniques, and this type of setup
will cause problems later.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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