-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.php
More file actions
98 lines (85 loc) · 5.04 KB
/
edit.php
File metadata and controls
98 lines (85 loc) · 5.04 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
require 'include/signupheader.php' ?>
<?php require 'include/header.php'; ?>
<?php
$conn = mysqli_connect('localhost', 'root', '', 'crud') or die("connection failed");
$id = $_GET['id'];
$sql = "SELECT * FROM data_base WHERE id='{$id}'";
$result = mysqli_query($conn, $sql) or die("Failed");
if (mysqli_num_rows($result) ) {
while($row = mysqli_fetch_assoc($result)){
?>
<!doctype html>
<html lang="en">
<head>
<title>Edit</title>
</head>
<body>
<div class="pagewrap">
<section>
<div class="hero-sec">
<div class="container">
<div class="via-content-img">
<div class="vie-banner-content">
<h1>Edit Your Form</h1>
<span></span>
<div class="registration-form">
<form method="post" action="update.php">
<div class="form-group">
<span></span>
<input type="hidden" class="form-control" id="Sr" name="sr" value="<?php echo $row['id']; ?>">
<input type="text" class="form-control" id="Name" placeholder="Name" name="name" value="<?php echo $row['name']; ?>">
</div>
<div class="form-group">
<span></span>
<input type="email" class="form-control" id="Email" aria-describedby="emailHelp" placeholder="Enter email" name="email" value="<?php echo $row['email']; ?>">
</div>
<div class="form-group">
<span></span>
<input type="password" class="form-control" id="Password" placeholder="Password" name="password" value="<?php echo $row['password']; ?>">
</div>
<div class="form-group">
<span></span>
<input type="file" onchange="readURL(this);"class="form-control-file" id="Image" placeholder="Upload Image" name="image" value="<?php echo $row['image']; ?>">
</div>
<button type="submit" class="btn btn-primary" value="update">Update</button>
</form>
<?php
}
}
?>
</div>
</div>
<div class="vie-banner-img">
<!-- <img src="images\header-img.png" alt="" class="img-fluid">-->
<div class="before-after-img">
</div>
<img id="blah" src="#" alt="" value="<?php echo $row['image']; ?>" />
</div>
</div>
</div>
</div>
</section>
<footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>
<script>
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah')
.attr('src', e.target.result)
.width(150)
.height(200);
};
reader.readAsDataURL(input.files[0]);
}
}
</script>
</footer>
</body>
</html>