36557-vm/register.php
Flatlogic Bot 08fcb2dae0 0.2
2025-12-01 21:25:15 +00:00

87 lines
4.3 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register - Your Brand</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link href="assets/css/auth.css" rel="stylesheet">
</head>
<body class="auth-wrapper">
<?php
require_once 'auth.php';
$error = '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['password'];
$sponsor_code = $_POST['sponsor_code'] ?? '';
$result = register($name, $email, $password, $sponsor_code);
if ($result === true) {
header("Location: login.php?registration=success");
exit;
} else {
$error = $result;
}
}
?>
<div class="auth-container">
<div class="auth-branding-section">
<a href="index.php" class="text-white text-decoration-none h1"> <i class="bi bi-buildings"></i> <?php echo htmlspecialchars($content['site_name']); ?></a>
<p class="lead mt-3">Join our network and start your journey with us today.</p>
</div>
<div class="auth-form-section">
<div class="text-center mb-5">
<h2>Create an Account</h2>
<p class="text-muted">Create a new account to get started.</p>
</div>
<?php if ($error): ?>
<div class="alert alert-danger"><?php echo htmlspecialchars($error); ?></div>
<?php endif; ?>
<form method="POST">
<div class="mb-3">
<label for="name" class="form-label">Full Name</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-person-fill"></i></span>
<input type="text" name="name" id="name" class="form-control form-control-lg" placeholder="e.g., John Doe" required>
</div>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email Address</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-envelope-fill"></i></span>
<input type="email" name="email" id="email" class="form-control form-control-lg" placeholder="e.g., name@example.com" required>
</div>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-lock-fill"></i></span>
<input type="password" name="password" id="password" class="form-control form-control-lg" placeholder="Create a strong password" required>
</div>
</div>
<div class="mb-4">
<label for="sponsor_code" class="form-label">Sponsor Code (Optional)</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-person-plus-fill"></i></span>
<input type="text" name="sponsor_code" id="sponsor_code" class="form-control form-control-lg" placeholder="Enter your sponsor's code">
</div>
</div>
<div class="d-grid mb-4">
<button type="submit" class="btn btn-primary btn-lg">Create Account</button>
</div>
<p class="text-center">Already have an account? <a href="login.php">Sign in</a>.</p>
</form>
<div class="text-center mt-5">
<a href="index.php" class="text-muted text-decoration-none"><i class="bi bi-arrow-left"></i> Back to Homepage</a>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>