-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkboxeditupdate.php
62 lines (49 loc) · 984 Bytes
/
checkboxeditupdate.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
include('config.php');
if(isset($_REQUEST["eid"]))
{
$eid=$_REQUEST["eid"];
$query=mysql_query("select * from user where id='$eid'");
$row=mysql_fetch_array($query);
$a=$row["education"];
$b=explode(",",$a);
}
if(isset($_REQUEST["submit"]))
{
$c=$_REQUEST["education"];
$d=implode(",",$c);
mysql_query("update user set education='$d' where id='$eid'");
header('location:select.php');
}
?>
<form method="post">
<table border="1" align="center">
<tr>
<td>Education</td>
<td><input type="checkbox" name="education[]" value="diploma"
<?php
if(in_array("diploma",$b))
{
echo "checked";
}
?>
>Diploma
<input type="checkbox" name="education[]" value="b.tech" <?php
if(in_array("b.tech",$b))
{
echo "checked";
}
?>>B.tech
<input type="checkbox" name="education[]" value="mba" <?php
if(in_array("mba",$b))
{
echo "checked";
}
?>>MBA
</td>
</tr>
<tr>
<td><input type="submit" value="submit" name="submit"></td>
</tr>
</table>
</form>