-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
117 lines (108 loc) · 4.42 KB
/
header.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
session_start();
include "php/dbConfig.php";
if(isset($_GET["novel_name"]))
$title=$_GET["novel_name"];
else
$title="WebStories";
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo($title); ?></title>
<meta name="keywords" content="Novel"/>
<meta name="description" content="Read Novels"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/mystyle.css">
<link href='https://unpkg.com/boxicons@2.0.9/css/boxicons.min.css' rel='stylesheet'>
<link rel="icon" href="img/favicon.png">
<script>
openForm = () =>{
document.getElementById("myForm").style.display = "block";
document.getElementById("overlay").style.display = "block";
}
closeForm = () => {
document.getElementById("myForm").style.display = "none";
document.getElementById("overlay").style.display = "none";
document.getElementById("register").style.display = "none";
}
openRegister = () => {
document.getElementById("myForm").style.display = "none";
document.getElementById("register").style.display = "block";
}
</script>
</head>
<body>
<div class="header" id="myHeader">
<div class="logo">
<img src="img/logo1.png">
</div>
<div class="nav">
<nav>
<a href="index.php">Home</a>
<a href="update.php">Updates</a>
<a href="novel.php">Novels</a>
</nav>
<div class="auth">
<?php
if(isset($_SESSION['login'])){
?>
<a href="mynovels.php">My Novels</a>
<div class="logout">
<a href="php/logout.php">Log Out</a>
</div>
<div class="logout-hidden">
<a href="php/logout.php"><i class='bx bx-log-out bx-md'></i></a>
</div>
<?php
}
else{
?>
<button class="login" onclick="openForm()">
<i class='bx bxs-user-circle bx-md' ></i> <p>Login/Register</p>
</button>
<button class="login-hidden" onclick="openForm()">
<i class='bx bxs-user-circle bx-md' ></i>
</button>
<div id="overlay" onclick="closeForm()">
</div>
<div class="form-popup" id="myForm">
<form action="php/login.php" method="post" class="form-container">
<h1>Login</h1>
<label for="username"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="username" id='elem' class="form-space" required>
<label for="password"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="password" id='pass' class="form-space" required>
<input type="submit" name="submit" value="Log In" class="btn">
<p>Dont have an account? <a onclick="openRegister()"> Register</a></p>
</form>
</div>
<div class="register-popup" id="register">
<form action="php/signup.php" method="post" class="form-container">
<h1>Register</h1>
Username:</br>
<input type="text" name="username" class="form-space"></br>
Password:</br>
<input type="password" name="password" class="form-space"></br>
Confirm Password:</br>
<input type="password" name="con_password" class="form-space"></br>
<input type="submit" name="submit" value="Sign Up" class="btn">
</form>
</div>
<?php
}
?>
</div>
<a class="icon" onclick="myFunction()"><i class='bx bx-menu bx-md' style='color:#ffffff' ></i></i></a>
</div>
</div>
<script>
function myFunction() {
var x = document.getElementById("myHeader");
if (x.className === "header") {
x.className += " responsive";
} else {
x.className = "header";
}
}
</script>