-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathup.php
More file actions
54 lines (32 loc) · 903 Bytes
/
up.php
File metadata and controls
54 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
<?php
include 'conn.php';
$xyz = $_GET['ids'];
if(isset($xyz)){
$sql = "SELECT * FROM `users` WHERE id='$xyz'";
$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="name" value="<?php echo $f['username']; ?>">
<input type="password" name="password" value="<?php echo $f['password']; ?>">
<input type="submit" name="submit">
</form>
<?php
if(isset($_POST['submit'])){
$password =$_POST['password'];
$name = $_POST['name'];
$update ="UPDATE `users` SET 'username`='$name',`password`='$password' WHERE id='$xyz'";
$update_q = mysqli_query($conn, $update);
if ($update_q){
header("location:reg.php");
}
}
}
}
}
else{
header("location:reg.php");
}
?>