Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>EDIT: I just caught this:</p> <p>You have nested <code>&lt;form&gt;</code> tags which is invalid and prone to unexpected behavior, you must fix that first (high priority). I can't tell which one you need to remove because I don't know your application, but it looks like the ones inside the <code>foreach</code> aren't supposed to be there, otherwise you wouldn't need to post an array of values.</p> <p>Anyways, assuming that <em>wasn't</em> the case...</p> <hr> <p>If this is your code:</p> <pre><code>foreach ($this-&gt;input-&gt;post('userdelete') as $row){ $deleteWhat = $row; } </code></pre> <p>Then <code>$deleteWhat</code> in each iteration contains the string that was posted, whatever was in the <code>value</code> of that checkbox.</p> <p>This <em>is</em> the array:</p> <pre><code>$this-&gt;input-&gt;post('userdelete') </code></pre> <p>It contains everything that was posted from <code>form_checkbox('userdelete[]', $user['id'])</code></p> <p>Your code is working fine. </p> <p>Just remember a few things:</p> <ul> <li><code>&lt;input name="somename[]"&gt;</code> will post as an array of values because of the brackets.</li> <li><code>$_POST['somename']</code> is equal to <code>$this-&gt;input-&gt;post('somename')</code>, except when the value isn't set (the first generates an undefined variable notice, the second returns <code>FALSE</code>)</li> <li>You may specify keys like: <code>&lt;input name="somename[hello]"&gt;</code></li> <li><code>&lt;input name="somename[hello][]"&gt;</code> will post an array of arrays, etc.</li> <li>Checkboxes don't post anything at all unless they are checked.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload