-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditdis.php
80 lines (60 loc) · 1.95 KB
/
editdis.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
ob_start();
include 'css/style.css';
include 'connection1.php';
include 'staff_header.php';
session_start();
$goos= $_SESSION['$goo'];
$sql = "select * from dis where name = '$goos' ";
$result = $conn->query($sql);
?>
<html>
<title>edit</title>
<body>
<?php include 'back_btn.php'; ?>
<h3 align="center">Edit Distributor</h3>
<div>
<form action="" method="post">
<center>
<table > <?php
if($result->num_rows > 0){
while($row=$result->fetch_assoc()){
?>
<tr>
<td>Name</td><td><input type="text" value="<?php echo $row['name']; ?>" name="id" required readonly="true"></td>
</tr>
<tr>
<td>Email</td><td><input type="text" value="<?php echo $row['email']; ?>"required name="name">
</tr>
<tr>
<td>Phone</td><td><input type="text" value="<?php echo $row['phone']; ?>" required name="place">
</tr>
<tr>
<td>Address</td><td><input type="text" value="<?php echo $row['address']; ?>" name="dname">
</tr>
<CENTER>
<tr>
<td colspan="2"> <input name="submit" type="submit" value="Update"></td>
</tr></CENTER>
<?php
}
}
if(isset($_POST['submit'])){
$name= $_POST['name'];
$place = $_POST['place'];
$dname = $_POST['dname'];
$sql2 = "update dis set email ='$name',phone ='$place',address='$dname' where name = '$goos' ";
$result = $conn->query($sql2);
if($result){
echo 'Data Updated';
unset($_SESSION["goo"]);
header("Location:profiledis.php");
}
}
?>
</table>
</form>
</div>
</center>
</body>
</html>