prepare("INSERT INTO clients (name, email, password, timezone) VALUES (?, ?, ?, ?)"); $stmt->execute([$name, $email, $hashed_password, $timezone]); $client_id = $pdo->lastInsertId(); $customer = \Stripe\Customer::create([ 'email' => $email, 'name' => $name, ]); $stripe_customer_id = $customer->id; $stmt = $pdo->prepare("UPDATE clients SET stripe_customer_id = ? WHERE id = ?"); $stmt->execute([$stripe_customer_id, $client_id]); $_SESSION['user_id'] = $client_id; $_SESSION['user_type'] = 'client'; header("Location: sign-contract.php"); exit; } catch (PDOException $e) { if ($e->getCode() == 23000) { // Integrity constraint violation $errors[] = "Email address already registered."; } else { $errors[] = "Database error: " . $e->getMessage(); } } } } ?> Client Registration

Create Your Client Account

Already have an account? Login