title: how can send multiple value by checkbox
body: <p>i have write code by ajax to sent name and roles by ajax, the name send success, but checkbox not send when choose more than 2 roles.</p>
  
  <p>ajax code </p>
  
  <pre><code>   var HttPRequest = false;
  
     function doCallAjax(Mode,Page,ID) {
        HttPRequest = false;
        if (window.XMLHttpRequest) { // Mozilla, Safari,...
           HttPRequest = new XMLHttpRequest();
           if (HttPRequest.overrideMimeType) {
              HttPRequest.overrideMimeType('text/html');
           }
        } else if (window.ActiveXObject) { // IE
           try {
              HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
           } catch (e) {
              try {
                 HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
              } catch (e) {}
           }
        } 
  
        if (!HttPRequest) {
           alert('Cannot create XMLHTTP instance');
           return false;
        }
  
        var url = 'AjaxRolesPermRecord.php';
        var pmeters = "troles_Name=" + encodeURI( document.getElementById("roles_Name").value) +
                      "&amp;tper=" + encodeURI( document.getElementById("per").value) +
                      '&amp;myPage='+Page +
                      "&amp;tID=" + ID +
                      "&amp;tMode=" + Mode;
  
          HttPRequest.open('POST',url,true);
  
          HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
          HttPRequest.setRequestHeader("Content-length", pmeters.length);
          HttPRequest.setRequestHeader("Connection", "close");
          HttPRequest.send(pmeters);
  
  
          HttPRequest.onreadystatechange = function()
          {
  
               if(HttPRequest.readyState == 3)  // Loading Request
                {
                 document.getElementById("mySpan").innerHTML = "load ...";
                }
  
               if(HttPRequest.readyState == 4) // Return Request
                {
                 document.getElementById("mySpan").innerHTML = HttPRequest.responseText;
                }
  
          }
  
     } 
  </code></pre>
  
  <p>and i get it on other page like this </p>
  
  <pre><code>foreach($selected as $key=&gt;$val) 
  {  
      $SqlInsertIntotable = mysql_query("INSERT INTO permissions_roles (id,permission_id,role_id) 
                                         value ('','".$val."','".$RoleID."')"); 
  }
  </code></pre>
  
  <p>the problem is </p>
  
  <pre><code>Invalid argument supplied for foreach()
  </code></pre>