-
Notifications
You must be signed in to change notification settings - Fork 0
/
OnlineLoan.php
60 lines (48 loc) · 1.49 KB
/
OnlineLoan.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
<?php
session_start();
if(!isset($_SESSION["User"]) & empty($_SESSION["User"])){
header('location:CustomerLogin.php');
}
?>
<!DOCTYPE html>
<html>
<body>
<h1>Step 1 : Select Account</h1><br>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
Enter Account No:<input type="text" name="AccNo" size="50" required>
<br><input type="submit" value="Next"><br><br>
</form>
<?php
if(isset($_POST) & !empty($_POST)){
$AccNo = $_POST['AccNo'];
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "Bank";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM Account WHERE Account_No='$AccNo'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$AccNo=$row['Account_No'];
$_SESSION['AccNo']=$AccNo;
header("location: OnlineLoan1.php");
//echo "<br> email: ". $row["email"]. " <br>Name: ". $row["name"]. " <br>password " . $row["password"] . "<br>";
}
}else{
echo "There is no account with this account no. Please check your account no";
}
//}else{
//echo "The email address or password that you've entered doesn't match any account.";
//}
$conn->close();
}
?>
<br><a href="LogOut.php">Log Out</a>
</body>
</html>