-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.php
More file actions
80 lines (62 loc) · 2.28 KB
/
edit.php
File metadata and controls
80 lines (62 loc) · 2.28 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
//database connection
include 'connection.php';
//Connetion check
if (!$conn) {
die("Connecon Failed" . mysqli_connect_error());
}
// Update data
$id = $_GET['editid'];
$sql = "select * from `testtable` where id=$id";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
// print_r($row);
$name = $row['name'];
$email = $row['email'];
$website = $row['website'];
$comment = $row['comment'];
$age = $row['age'];
// echo $name;
?>
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>
<body class="h-100">
<div class="container h-100">
<div class="row h-100 justify-content-center align-items-center">
<div class="col-10 col-md-8 col-lg-6">
<!-- Form -->
<form class="form-example" action="update.php?id=<?php echo $id; ?>" method="post" data-bitwarden-watching="1">
<h1>Add your personal data</h1>
<p class="description">Your data will be stored in a secure place.</p>
<!-- Input fields -->
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control username" placeholder="Full Name" name="name" value="<?php echo $name; ?>">
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="text" class="form-control" placeholder="name@mail.com" name="email" value="<?php echo $email; ?>">
</div>
<div class="form-group">
<label for="website">Website:</label>
<input type="text" class="form-control " placeholder="www.website.com" name="website" value="<?php echo $website; ?>">
</div>
<div class="form-group">
<label for="age">Age:</label>
<input type="int" class="form-control " placeholder="22" name="age" value="<?php echo $age; ?>">
</div>
<div class="form-group">
<label for="comment">Comment:</label>
<textarea class="form-control" placeholder="I have a cat ....." rows="3" name="comment"><?php echo $comment; ?></textarea>
</div><br>
<button type="submit" class="btn btn-primary">Update</button>
<!-- End input fields -->
</form>
<!-- Form end -->
</div>
</div>
</div>
</body>
</html>