initial commit

This commit is contained in:
2023-07-05 20:42:06 +02:00
commit fafe28f9f1
9 changed files with 809 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
session_start();
if (!isset($_SESSION["username"])) {
header("Location: /"); // Redirect to the login page if not logged in
exit;
}
$username = $_SESSION["username"];
$env = parse_ini_file(".env");
// Connect to db
$conn = new mysqli($env["HOST"], $env["DBUSER"], $env["DBPASS"], $env["TABLE"]);
if($conn->connect_error) {
die("Database connection failed: " . $conn->connect_error);
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Dashboard - CineTrack</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h2>Willkommen, <?php echo $username; ?>!</h2>
<a href="logout.php">Logout</a>
<br>
<form method="post" action="search.php">
<input type="text" placeholder="Title" name="term" required>
<input value="Search" type="submit">
</form>
<?php $conn->close(); ?>
</body>
</html>