-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.php
More file actions
63 lines (32 loc) · 903 Bytes
/
update.php
File metadata and controls
63 lines (32 loc) · 903 Bytes
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
<?php
include 'connection.php';
$ids = $_GET['ids'];
if(isset($ids)){
$sql = "SELECT * FROM `name` WHERE id='$ids'";
$sql_run = mysqli_query($conn, $sql);
$row = mysqli_num_rows($sql_run);
if($row>0){
while($f = mysqli_fetch_array($sql_run)){
?>
<form method="post">
<input type="text" name="user" value="<?php echo $f['name']; ?>">
<input type="text" name="phone" value="<?php echo $f['phone']; ?>">
<input type="submit" name="submit">
</form>
<?php
if(isset($_POST['submit'])){
$phone =$_POST['phone'];
$user = $_POST['user'];
$update ="UPDATE `name` SET `name`='$user',`phone`='$phone' WHERE id= '$ids' ";
$update_q = mysqli_query($conn, $update);
if ($update_q){
header("location:registration.php");
}
}
}
}
}
else{
header("location:registration.php");
}
?>