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