I need some assistance changing a single select into a multiple select form drop-down. I am having issues with the multiple selections storing. The function loops through all of the users and assigns a drop-down where I can select the folder they have access to. I'm not having any luck trying to assign more than one folder to each user. Thank you for your help!

PHP Code:
$var "
            <script type='text/javascript'>
            jQuery(function(){

                     jQuery('form').attr('method', 'get');
                     jQuery('form').after('<input type=\"submit\"  id=\"doaction_k2\" class=\"button-secondary action\" value=\"Apply Folder Access\" style=\"background: red; color: #fff;\">');


                var thisurl = '';
                var thaturl = '';
                jQuery('#doaction_k2').live('click', function(){
                       jQuery('.new_file_access').each(function(){
                        thisurl = thisurl + '|' + jQuery(this).attr('userid') + '~' + jQuery(this).val();
                       });

                       jQuery('.new_file_readwrite').each(function(){
                        thaturl = thaturl + '|' + jQuery(this).attr('userid') + '~' + jQuery(this).val();
                       });

                    jQuery.post(document.URL, { update_access: 1, file_access: thisurl, file_readwrite: thaturl }, function(){
                        window.location = document.URL;
                    });

                    return false;
                    });
                });

            </script>"
;
        }

            
$var .= "<select multiple='yes' id='file_manager_accessk".$user_id."' class='new_file_access' userid='$user_id'><option value='' $noaccess>No Access</option>";

            foreach(
$ACCESS_ARRAY as $key=>$value)
            {
                    
$key str_replace('\\''/'$key);
                    
$keys $key .'~'$urls.'/'.$value;
                    
$keys substr($keys0strlen($keys)-1);
                    
$keys1 base64_encode($keys);

                    
$var .= "<option value='$keys1$select[$keys]>$value</option>";
            }
            
$var .= "</select>";
            return 
$var;
            break;