-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccountedit.php
More file actions
68 lines (58 loc) · 1.64 KB
/
Copy pathaccountedit.php
File metadata and controls
68 lines (58 loc) · 1.64 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
<?php
session_start();
$connection = mysqli_connect("localhost","root","","bankaccount");
$database = mysqli_select_db($connection,"bankaccount");
$id=$_SESSION['id'];
$sql="SELECT * FROM banktable WHERE id='$id'";
$result=mysqli_query($connection,$sql);
$rows=mysqli_fetch_array($result);
if(isset($_POST["update"])){
$fullname = $_POST["fullname"];
$accountpin = $_POST["accountpin"];
$accountnum = $_POST["accountnum"];
$query = "UPDATE banktable SET fullname = '$fullname',account_pin = '$accountpin', account_number = '$accountnum' WHERE id = '$id'";
$result = mysqli_query($connection,$query);
?>
<script type="text/javascript">
alert("Update Successfull.");
window.location = "accountprofile.php";
</script>
<?php
}
?>
<!DOCTYPE html>
<html>
<head>
<style>
#hide{
display: block;
}
#full{
width: 200px;
height: 30px;
text-align: center;
margin-right: 100px;
}
select {
width: 200px;
height: 30px;
margin-right: 200px;
}
#upd{
width: 200px;
height: 30px;
margin-right: 300px;
}
</style>
</head>
<body>
<div id="edit">
<form method="POST" action="accountedit.php">
<input name="fullname" id="full" value="<?php echo @$rows["fullname"]; ?>">
<input name="accountpin" class="af" value="<?php echo @$rows["accountpin"];?>">
<input name="accountnum" class="af" value="<?php echo @$rows["accountnum"];?>">
<input type="submit" id="upd" name="update" value="update">
</form>
</div>
</body>
</html>