Hello!
I use php 4.3.4 on windows and apache.
I a form with checkboxes with POST variables.
The problems is that I don't manage to empty this array,
and the test (if test) that checks if this array isset always turns true, even if the user hasn't tagged the checkbox more than the first time the page is displayed.
This results in that I do a database insert every time the page is refreshed.
this is the form:
<form name="booking_list[]" method="post" action="act1.php">
<?php
// date $thedate;
for($i = 0 ; $i < sizeof($tree[RESULT_SET][0][HOMEPAGE]) ; $i++)
{
// $temp_start == date($tree[RESULT_SET][0][START][$i][VALUE]);
// $temp_stop == date($tree[RESULT_SET][0][STOP][$i][VALUE]);
// inne i if:$temp_start <= $thedate <= $temp_stop
<td><input type="checkbox" name="booking_list[]" value="<?php echo ($tree[RESULT_SET][0][ACTID2][$i][VALUE]?>"> </td>
<?php
echo "<td>"; ?> <a href="HTTP:// <?php echo $tree[RESULT_SET][0][HOMEPAGE][$i][VALUE]?>"</> HOMEPAGE</a><?php echo "</td>";
echo "<br>";
} // end if test
} // end for-test
?>
<input type="submit" name="Submit" value="Submit">
</form>
I've tried these statements to empty the array:
$booking_list[] = array();
$booking_list[] = null;
$book[] = array();
$book[] = null;
$POST['booking_list'] = array();
$POST['booking_list'] = null;
$GLOBALS['booking_list'] = null;
But the isset test on booking_list always turns true.
Can anyone help me out?
Best regards,
Tom-Erik