PNG IHDR x sBIT|d pHYs + tEXtSoftware www.inkscape.org< ,tEXtComment
<?php
session_start();
$errors = [];
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$fullname = trim($_POST['fullname']);
$email = filter_var(trim($_POST['email']), FILTER_SANITIZE_EMAIL);
$password = $_POST['password'];
$confirm_password = $_POST['confirm_password'];
if (empty($fullname) || empty($email) || empty($password) || empty($confirm_password)) {
$errors[] = "All fields are required.";
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$errors[] = "Invalid email address.";
} elseif ($password !== $confirm_password) {
$errors[] = "Passwords do not match.";
} elseif (strlen($password) < 8) {
$errors[] = "Password must be at least 8 characters.";
}
if (empty($errors)) {
$_SESSION['signup'] = [
'fullname' => $fullname,
'email' => $email,
'password' => password_hash($password, PASSWORD_DEFAULT)
];
header("Location: signup_step2.php");
exit;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sign Up - Step 1</title>
<style>
body {font-family: Arial, sans-serif; background:#f2f2f2;}
.container {max-width:400px; margin:80px auto; background:#fff; padding:30px; border-radius:12px; box-shadow:0 0 15px rgba(0,0,0,.1);}
h2 {text-align:center; margin-bottom:20px; color:#003366;}
input {width:100%; padding:12px; margin:8px 0; border:1px solid #ccc; border-radius:6px;}
button {width:100%; padding:12px; background:#003366; color:#fff; border:none; border-radius:6px; cursor:pointer;}
button:hover {background:#0055aa;}
.error {color:red; margin:10px 0;}
</style>
</head>
<body>
<div class="container">
<h2>Create Your Account</h2>
<?php foreach($errors as $e): ?><p class="error"><?= htmlspecialchars($e) ?></p><?php endforeach; ?>
<form method="post">
<input type="text" name="fullname" placeholder="Full Name" required>
<input type="email" name="email" placeholder="Email Address" required>
<input type="password" name="password" placeholder="Password" required>
<input type="password" name="confirm_password" placeholder="Confirm Password" required>
<button type="submit">Next</button>
</form>
</div>
</body>
</html>
b IDATxytVսϓ22 A@IR:hCiZ[v*E:WũZA ^dQeQ @ !jZ'>gsV仿$|?g)&x-E