-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedituser.php
More file actions
65 lines (58 loc) · 2.14 KB
/
edituser.php
File metadata and controls
65 lines (58 loc) · 2.14 KB
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
<?php
include "condb.php";
$id = $_GET['id'];
$sql = "select *from register where id = $id";
$result = mysqli_query($con,$sql);
$row = mysqli_fetch_array($result);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<title>DesignX</title>
</head>
<?php
if(isset($_POST['submit'])){
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$sql = "update register set username='$username',email='$email',password='$password' where id='$id'";
$result = mysqli_query($con,$sql);
if($result){
header("location:alluser.php");
}else{
echo "User Not Edited !!!";
}
}
?>
<body>
<section class="editsection"></section>
<div class="center">
<h1>User</h1>
<form method="POST">
<div class="txt_field">
<input type="text" name="username" value="<?php echo $row['username']; ?>"required>
<span></span>
<label>UserName</label>
</div>
<div class="txt_field">
<input type="email" name="email" value="<?php echo $row['email']; ?>"required>
<span></span>
<label>EmailId</label>
</div>
<div class="txt_field">
<input type="password" name="password" value="<?php echo $row['password']; ?>" required>
<span></span>
<label>Password</label>
</div>
<input type="submit" class="submit" name="submit" value="Update">
</form>
</div>
</body>
</html>