forked from Gerina-MC/Seamless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
70 lines (70 loc) · 3.49 KB
/
login.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
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" type="text/css" href="style_form.css">
<meta charset="utf-8">
<style>
.navbar{
background-color: #f3f3f3;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<nav class="navbar navbar-expand-md navbar-light fixed-top" style="width:100%">
<div class="container-fluid navbar-left">
<a href="index.php" class="navbar-brand navbar-left">
<h2><img src="Seamlogo.svg" alt="Seamless logo" class="d-inline-block align-text-center" style="height:50px;width:50px;">
Seamless</h2>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</div>
<div class="navbar-nav" >
<div class="collapse navbar-collapse navbar-right" id="collapsibleNavbar">
<a class="nav-link" style="padding-left:10px" href="index.php">Home</a>
<a class="nav-link" style="padding-left:10px" href="browse.php">Browse</a>
<a class="nav-link" style="padding-left:10px" href="about.php">About</a>
<?PHP
session_start();
if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
echo "<a class='nav-link active' style='padding-left:10px' href='login.php'>Login</a>";
}
else{
echo "<a class='nav-link' style='padding-left:10px' href='design_upload.php'>Upload Design</a>";
echo "<a class='nav-link' style='padding-left:10px' href='profile.php'>Profile</a>";
echo "<a class='nav-link' style='padding-left:10px' href='logout.php'>Logout</a>";
}
?>
</div>
</div>
</nav>
<div style="height:85px"></div>
<?PHP
if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
?>
<div id = "frm">
<h2 style="text-align:center">Login</h2>
<form name="f1" action = "authentication.php" onsubmit = "return validation()" method = "POST">
<label> Username: </label><br>
<input type = "text" id ="user" name = "user" style="width: 150px;" required/><br>
<label> Password: </label><br>
<input type = "password" id ="pass" name = "pass" style="width: 150px;" required/><br><br>
<input type = "submit" id = "btn" value = "Login" class="btn btn-primary"/><br>
<p>
New user??Click here to <a href="register.php">register</a>
</p>
</form>
</div>
<?php
}
else{
echo "<h3>Already logged in...<a href='logout.php'>logout</a> to login again</h3>";
}
?>
</body>
</html>