Files
sam-api/public/tenant/api/register_process.php
2025-08-10 02:36:50 +09:00

28 lines
881 B
PHP

<?php
session_start();
// POST 데이터 받기
$userid = isset($_POST['userid']) ? trim($_POST['userid']) : '';
$username = isset($_POST['username']) ? trim($_POST['username']) : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
$password2 = isset($_POST['password2']) ? $_POST['password2'] : '';
// 기본 밸리데이션
if (!$userid || !$username || !$password || !$password2) {
echo "<script>alert('모든 항목을 입력하세요.'); history.back();</script>";
exit;
}
if ($password !== $password2) {
echo "<script>alert('비밀번호가 일치하지 않습니다.'); history.back();</script>";
exit;
}
// 실제로는 DB에 유저 등록해야 하지만, 샘플이므로 생략
// 세션 생성 (user로)
$_SESSION['user_id'] = 'user';
// 가입 성공 → 대시보드 이동
header("Location: /tenant/member/dashboard.php");
exit;