-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit.php
53 lines (49 loc) · 1.64 KB
/
edit.php
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
<?php
include("db.php");
$getid = $_GET['edit'];
$seledittwo = "SELECT * FROM `custmer` WHERE `id` = '$getid'";
$qry = mysqli_query($cooect, $seledittwo);
$selassoc = mysqli_fetch_assoc($qry);
$id = $selassoc['id'];
$first = $selassoc['first'];
$last = $selassoc['last'];
$email = $selassoc['email'];
if(isset($_POST['updat'])) {
$upid = $_POST['upid'];
$upfirst= $_POST['upfirst'];
$uplast = $_POST['uplast'];
$upemail = $_POST['upemail'];
$seleditt = "UPDATE `custmer` SET `first`='$upfirst',`last`='$uplast',`email`='$upemail' WHERE `id` = '$upid'";
$qry = mysqli_query($cooect,$seleditt);
if($qry) {
header("location: home.php");
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="css\test2.css">
<title>edit</title>
</head>
<body>
<div class="container">
<div class="page-left">
<div class="header">
<div class="header1">Welcome Back</div>
<div class="header2">Room Rent Price Is (<b>30$</b>)</div>
</div>
<div class="form-page">
<form action="" method="post">
<input type="hidden" name="upid" value="<?php echo $id; ?>"/>
<input class="first" type="text" name="upfirst" value="<?php echo $first; ?>" /><br><br>
<input class="last" type="text" name="uplast" value="<?php echo $last; ?>"/><br><br>
<input class="email-add " type="text" name="upemail" value="<?php echo $email; ?>"/><br><br>
<input type="submit" class="login" name="updat" value="Run">
</form>
</div>
</div>
<div class="page-right"></div>
</div>
</body>
</html>