checkboxen-afhandelen
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?
function checkboxjes($id, $field, $first = '', $end = '')
{
$count = count($id);
for ($i = 0; $i < $count; $i++)
{
$hack = strstr($id[$i], ";");
if($hack)
{
exit("ERROR: INVALID INPUT<br>". $hack ." IS NOT ALLOWED");
}
else
{
if(!$sBack)
{
$sBack = " WHERE `". $field ."` = '". $id[$i] ."' ";
}
else
{
$sBack .= "OR `". $field ."` = '". $id[$i] ."' ";
}
}
}
$eind = $first.$sBack.$end;
return $eind;
}
?>
function checkboxjes($id, $field, $first = '', $end = '')
{
$count = count($id);
for ($i = 0; $i < $count; $i++)
{
$hack = strstr($id[$i], ";");
if($hack)
{
exit("ERROR: INVALID INPUT<br>". $hack ." IS NOT ALLOWED");
}
else
{
if(!$sBack)
{
$sBack = " WHERE `". $field ."` = '". $id[$i] ."' ";
}
else
{
$sBack .= "OR `". $field ."` = '". $id[$i] ."' ";
}
}
}
$eind = $first.$sBack.$end;
return $eind;
}
?>