-
Notifications
You must be signed in to change notification settings - Fork 0
/
karbar.php
45 lines (44 loc) · 1.39 KB
/
karbar.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
<form name="fm" method="post">
<div class="divtable">
<table>
<tr>
<td>انتخاب کاربر</td>
<td>
<select name="select">
<option select="selected">انتخاب کنید</option>
<?php
$sql1="select username from sabtenam ";
$result1 = runSelect($sql1);
while ($row =$result1->fetch(PDO::FETCH_ASSOC)){
echo '<option>'.$row['username'].'</option>';
}
?>
</select>
</td>
</tr>
<tr>
<td>سطح دسترسی را تعیین کنید</td>
<td><input type="text" name="sath"></td>
</tr>
<tr>
<td></td><td></td><td><input type="submit" name="sub"></td><td><?php echo $error; ?></td>
</tr>
</table>
</div>
</form>
</div>
<?php
if($_SERVER['REQUEST_METHOD']=="POST") {
$a=$_POST['sath'];
$v=$_POST['select'];
if($a==null){
$error="لطفا فیلد را پر نمایید";
}
else{
$m=$_POST['sath'];
$vs=$_POST['select'];
$qury = "update sabtenam SET level=".$m." where username='".$vs."'";
$result1 = runupdate($qury);
}
}
?>