File: /home/bigisxfd/public_html/cowork/register.php
<?php
require_once("functions.php");
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$firstname = $_POST["firstname"];
$lastname = $_POST["lastname"];
$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];
if (registerUser($firstname, $lastname, $username, $password, $email)) {
$registrationSuccess = "Registration successful";
} else {
$registrationError = "Registration failed";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Register</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="center-container">
<div class="container">
<img src="https://cowork.yuuinnovations.com/images/bigideas.jpg" alt="Logo" class="logo">
<h2>Register Admin Staff</h2>
<?php if (isset($registrationSuccess)) { echo "<p class='success'>$registrationSuccess</p>"; } ?>
<?php if (isset($registrationError)) { echo "<p class='error'>$registrationError</p>"; } ?>
<form method="post" action="">
<label>First Name:</label>
<input type="text" name="firstname" required><br>
<label>Last Name:</label>
<input type="text" name="lastname" required><br>
<label>Username:</label>
<input type="text" name="username" required><br>
<label>Password:</label>
<input type="password" name="password" required><br>
<label>Email:</label>
<input type="email" name="email" required><br>
<input type="submit" value="Register">
</form>
</div>
</div>
</body>
</html>