-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditretailer.php
78 lines (61 loc) · 1.96 KB
/
editretailer.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
<?php
ob_start();
include 'css/style.css';
include 'connection1.php';
include 'userheader.php';
session_start();
$goos= $_SESSION['$goo'];
$sql = "select * from retail where name = '$goos' ";
$result = $conn->query($sql);
?>
<html>
<title>edit</title>
<body>
<?php include 'back_btn1.php'; ?>
<h3 align="center">Edit Retailer</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="dsname">
</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'];
$dsname = $_POST['dsname'];
$pname=$POST['pname'];
$sql2 = "update retail set email ='$name',phone ='$place',address='$dsname' where name = '$goos' ";
$result = $conn->query($sql2);
if($result){
echo 'Data Updated';
unset($_SESSION["goo"]);
header("Location:profileretail.php");
}
}
?>
</table>
</form>
</div>
</center>
</body>
</html>