This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
99 lines (92 loc) · 3.83 KB
/
index.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
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
99
<?php
// Ny kode for å lage session og logge inn på konto
session_start();
if(isset($_SESSION['email'])) {
header("location: home.php");
die();
}
// Connect to database
include 'connect_mysql/connect.php';
$conn = OpenCon();
if($conn) {
if(isset($_POST['login_btn'])) {
$email=mysqli_real_escape_string($conn,$_POST['email']);
$password=mysqli_real_escape_string($conn,$_POST['password']);
$password=md5($password); //Remember we hashed password before storing last time
$sql="SELECT * FROM Customer WHERE email='$email' AND password='$password'";
$result=mysqli_query($conn,$sql);
if($result){
if( mysqli_num_rows($result)>=1) {
$_SESSION['message']="You are now Loggged In";
$_SESSION['email']=$email;
header("location:home.php");
} else{
echo '<script language="javascript">';
echo 'alert("Email and password combination is not correct!")';
echo '</script>';
}
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="main.css" />
<title>Finance Budget App</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<header class="block">
<!-- <h1 class="myTextFont">Finance Budget App</h1> -->
<img src="Pictures/logo.png" alt="logo" width="300" height="300" />
</header>
<main class="block" style="flex-wrap: wrap-reverse;">
<?php
if(isset($_SESSION['message'])) {
echo "<div id='error_msg'>".$_SESSION['message']."</div>";
unset($_SESSION['message']);
}
?>
<div class="contentBox" style="max-width: 640px;">
<h2>Why choose finance budgeting app 😍</h2>
<ul style="margin: 10px;">
<li style="margin-bottom: 25px; font-size: 20px;">If you are not able to keep track of your economy and spendings 💸</li>
<li style="margin-bottom: 25px; font-size: 20px;">You do not have a place to organize your spendings 💹</li>
<li style="margin-bottom: 25px; font-size: 20px;">You want to have a tool that you can use together with family and friends 👪</li>
<li style="margin-bottom: 25px; font-size: 20px;">You want to have fun and have a gameified experience and get achievements while saving money 🎮</li>
<li style="margin-bottom: 25px; font-size: 20px;">Safe place to keep your finance information secure 🔐</li>
</ul>
</div>
<form class="block" action="index.php" method="post">
<div class="contentBox" style="max-width: 320px;">
<label style="margin-top: 50px;">E-mail</label>
<input type="text" name='email' required>
<label>Password</label>
<input type="password" name='password' required>
<a><button type="submit" value="login" class="loginButton" name="login_btn">Log in</button></a>
<button style="margin-bottom: 10px;"class="loginButton"><a href="Register/register.php">Register</a></button>
<button style="margin-top: 5px;"class="loginButton"><a href="forgot-password/forgot-password.php">Forgot password</a></button>
</div>
</form>
</main>
<footer>
<ul>
<li>
<a href="offlineSites/faqOffline.php">FAQ</a>
</li>
<li>
<a href="offlineSites/aboutOffline.php">About</a>
</li>
<li>
<a href='offlineSites/contactFormOffline/index.php'>Contact</a>
</li>
</ul>
<p>© 2021 Finance Budget App AS</p>
</footer>
</body>
</html>