Get value of check box after "uncheck"
Hi. I'm new to php.
Say I have a check box which is checked already. Now I need to uncheck it and when I press the submit button, I should get the unchecked value. Can anyone help me on this.
One.php
if($qry[0]!=$login_type)
{
echo "<td class=tabhead align=center style=background-color:#CC66CC><input type=checkbox name=disable value=a".$count." checked DISABLED /></br>".$slot_value."</td>";
}
else
{
echo "<td class=tabhead align=center style=background-color:#00CCCC><input type=checkbox name=enable[] value='--user ".$slot_value." --ne ".$nen." --timespec ".$slt."' checked ></br>".$slot_value."</td>";
}
One.php calls Two.php
Two.php
$enable_slot= $_POST['enable'];
$uncheck_slot= $_POST['uncheck'];
if ($uncheck_slot){
foreach($uncheck_slot as &$k) {
echo "<p>".$k." --reserve</p>";
}
}
if ($enable_slot){
echo "$enable_slot";
foreach($enable_slot as &$a) {
echo "<p>".$a." --unreserve</p>";
}
}
I get only the results only if checked. I think I'm doing a mistake in the code in red font.
Any help is appreciated.
__________________
Rummy
|