-
Notifications
You must be signed in to change notification settings - Fork 0
/
transfer.php
63 lines (61 loc) · 1.9 KB
/
transfer.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
54
55
56
57
58
59
60
61
62
63
<?php
session_start();
$db="bank";
$connect = mysqli_connect('localhost','root','',$db);
if(isset($_GET['name'])){
$name=$_GET['name'];
}
$result = mysqli_query($connect,"SELECT * FROM customer WHERE name='$name'");
$result2=mysqli_query($connect,"SELECT * FROM customer");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Basic Banking System</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<header>
<h3>BASIC BANKING SYSTEM</h3>
</header>
<form method="get" action="index.php">
<center><button id="home">HOME</button></center>
</form>
<center>
<h1>Transfer</h1>
<form action="transaction.php?name=<?php echo $name ?>" method="post">
<table>
<tr>
<td> From:
</td>
<td><?php echo "$name" ?>
</td>
</tr>
<tr>
<td> To:</td>
<td>
<select name="to">
<?php
while($row=mysqli_fetch_array($result2)){
?>
<option value="<?php echo $row['name']; ?>"> <?php echo $row['name']; ?></option>
<?php }
?>
</select>
</td>
</tr>
<tr>
<td> Amount:</td><td><input type="text" name="amount"></td>
</tr>
</table>
<button type="submit" onclick="alert('Transaction successfully completed');" name="submit" id="submit" value="submit">Send</button>
</form><br>
</center>
</body>
<footer>
<small>© Copyright 2020, Afeefa Abdullah Manjanoor</small>
</footer>
</body>
</html>