File: /home/bigisxfd/public_html/cowork/index.php
<?php
session_start();
require_once("functions.php");
if (isset($_POST['username']) && isset($_POST['password'])) {
$username = $_POST['username'];
$password = $_POST['password'];
if (login($username, $password)) {
// Successful login
$_SESSION['loggedin'] = true;
header("Location: dashboard.php"); // Redirect to dashboard or wherever you want
exit();
} else {
// Failed login
// Handle error messages or display login form again
}
}
?>
<!-- Rest of your HTML and form -->
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="center-container">
<div class="container">
<img src="images/bigideas.jpg" alt="Logo" class="logo">
<h2>Login</h2>
<?php if (isset($loginError)) { echo "<p class='error'>$loginError</p>"; } ?>
<form method="post" action="">
<label>Username:</label>
<input type="text" name="username" required><br>
<label>Password:</label>
<input type="password" name="password" required><br>
<input type="submit" value="Login">
</form>
</div>
</div>
</body>
</html>