Jump to content

[SOLVED] Logical Issue (passing data via checkboxes)


Ninjakreborn

Recommended Posts

There is no way to really quickly explain this.

 

So here is the code.

<?php
while ($row = mysql_fetch_array($query)) {
echo $row['username'];
$selectpermissions = "SELECT * FROM permissions WHERE projectid = '$projectid' AND clientid = '{$row[id]}';";
$querypermissions = mysql_query($selectpermissions);
if ($rowpermissions = mysql_fetch_array($querypermissions)) {
echo "<input name=\"level[]\" type=\"checkbox\" value=\"{$row[id]}.Enabled\" checked=\"checked\" />";
}else {
echo "<input name=\"level[]\" type=\"checkbox\" value=\"{$row[id]}.Disabled\" />";
}
?>

Basically pulling this information from teh database, it's either already enabled or disabled.  That's fine.  They alter this data on this page (however they end up altering it).  In the end they sent it to another page, it resets the per missions.  I need a way to tell which one's are enabled, and which ones are disabled.  I tried to just set this array, but I have no way to tell which are enabled,a nd which are enabled.  because they are coming fresh, I have no way to tell.  I can't name one enabled and one disabled, because I have no way of knowing ahead of time which is which.

Any advice?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.