halohalo
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
u295559686
/
domains
/
stanjo.in
/
public_html
/
Upload FileeE
HOME
<?php ob_start(); if (session_status() === PHP_SESSION_NONE) { session_start(); } include_once("admin/config.php"); $error = ''; if (isset($_SESSION['customer_id'])) { $redirect = isset($_GET['redirect']) ? $_GET['redirect'] : 'index.php'; header("Location: $redirect"); exit; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $first_name = $conn->real_escape_string($_POST['first_name']); $last_name = $conn->real_escape_string($_POST['last_name']); $email = $conn->real_escape_string($_POST['email']); $phone = $conn->real_escape_string($_POST['phone']); $password = $_POST['password']; $confirm_password = $_POST['confirm_password']; if ($password !== $confirm_password) { $error = "Passwords do not match."; } else { $checkEmail = $conn->query("SELECT id FROM users WHERE email = '$email'"); if ($checkEmail->num_rows > 0) { $error = "Email already registered."; } else { $hashed_password = password_hash($password, PASSWORD_DEFAULT); $full_name = $first_name . ' ' . $last_name; $sql = "INSERT INTO users (name, email, phone, password) VALUES ('$full_name', '$email', '$phone', '$hashed_password')"; if ($conn->query($sql)) { $_SESSION['customer_id'] = $conn->insert_id; $_SESSION['customer_name'] = $full_name; $redirect = isset($_GET['redirect']) ? $_GET['redirect'] : 'index.php'; header("Location: $redirect"); exit; } else { $error = "Registration failed. Please try again."; } } } } $pageTitle = 'Create Account'; include 'header.php'; ?> <main class="mt-[80px] min-h-[80vh] flex items-center justify-center py-16 bg-[#0b0b0b]"> <div class="w-full max-w-[520px] px-6 mx-auto"> <div class="text-center mb-10"> <h1 class="text-3xl font-light text-white mb-3 font-heading uppercase tracking-widest">Create Account</h1> <p class="text-[#888] text-sm font-light">Join Stanjo and experience premium lighting</p> </div> <div class="bg-[#111] border border-[#222] rounded-[16px] p-10"> <?php if ($error): ?> <div class="bg-red-900/50 border border-red-500 text-red-200 px-4 py-3 rounded mb-6 text-sm"> <?= $error ?> </div> <?php endif; ?> <form class="space-y-7" method="POST"> <div class="grid grid-cols-2 gap-6"> <div> <label class="block text-xs uppercase tracking-widest text-[#888] mb-3">First Name</label> <input type="text" name="first_name" class="w-full bg-transparent border-b border-[#333] text-white py-3 text-[15px] focus:outline-none focus:border-[#00a3ff] transition-colors placeholder-[#555] font-light" placeholder="First" required> </div> <div> <label class="block text-xs uppercase tracking-widest text-[#888] mb-3">Last Name</label> <input type="text" name="last_name" class="w-full bg-transparent border-b border-[#333] text-white py-3 text-[15px] focus:outline-none focus:border-[#00a3ff] transition-colors placeholder-[#555] font-light" placeholder="Last" required> </div> </div> <div> <label class="block text-xs uppercase tracking-widest text-[#888] mb-3">Email Address</label> <input type="email" name="email" class="w-full bg-transparent border-b border-[#333] text-white py-3 text-[15px] focus:outline-none focus:border-[#00a3ff] transition-colors placeholder-[#555] font-light" placeholder="you@example.com" required> </div> <div> <label class="block text-xs uppercase tracking-widest text-[#888] mb-3">Phone Number</label> <input type="tel" name="phone" class="w-full bg-transparent border-b border-[#333] text-white py-3 text-[15px] focus:outline-none focus:border-[#00a3ff] transition-colors placeholder-[#555] font-light" placeholder="+91 00000 00000"> </div> <div> <label class="block text-xs uppercase tracking-widest text-[#888] mb-3">Password</label> <input type="password" name="password" class="w-full bg-transparent border-b border-[#333] text-white py-3 text-[15px] focus:outline-none focus:border-[#00a3ff] transition-colors placeholder-[#555] font-light" placeholder="••••••••" required> </div> <div> <label class="block text-xs uppercase tracking-widest text-[#888] mb-3">Confirm Password</label> <input type="password" name="confirm_password" class="w-full bg-transparent border-b border-[#333] text-white py-3 text-[15px] focus:outline-none focus:border-[#00a3ff] transition-colors placeholder-[#555] font-light" placeholder="••••••••" required> </div> <div class="flex items-start gap-3 pt-2"> <input type="checkbox" id="terms" class="accent-[#00a3ff] mt-1" required> <label for="terms" class="text-[#888] text-sm font-light cursor-pointer leading-relaxed">I agree to the <a href="#" class="text-[#00a3ff] hover:underline">Terms of Service</a> and <a href="#" class="text-[#00a3ff] hover:underline">Privacy Policy</a></label> </div> <button type="submit" class="w-full bg-[#00a3ff] hover:bg-[#008be5] text-white font-medium py-4 rounded-full transition-colors text-[15px] uppercase tracking-wide mt-2">Create Account</button> </form> <div class="mt-8 pt-8 border-t border-[#222] text-center"> <p class="text-[#888] text-sm font-light">Already have an account? <a href="login.php<?= isset($_GET['redirect']) ? '?redirect='.urlencode($_GET['redirect']) : '' ?>" class="text-[#00a3ff] hover:underline">Sign in</a></p> </div> </div> </div> </main> <?php include 'footer.php'; ?>