web1/pg/member_process.php
2025-12-04 11:20:33 +09:00

31 lines
791 B
PHP

<?php
include '../config/dbconfig.php'; //상대경로
include '../config/member.php';
$mem = new Member($db);
$id = (isset($_POST['id']) && $_POST['id'] != '') ? $_POST['id'] : '';
$email = (isset($_POST['email']) && $_POST['email'] != '') ? $_POST['email'] : '';
if($_POST['mode'] == 'id_chk') {
if($id == '') {
die(json_encode(['result' => 'empty_id']));
}
if($mem->id_exists($id)) {
die(json_encode(['result' => 'fail']));
}else {
die(json_encode(['result' => 'success']));
}
}
if($_POST['mode'] == 'email_chk') {
if($email == '') {
die(json_encode(['result' => 'empty_email']));
}
if($mem->email_exists($email)) {
die(json_encode(['result' => 'fail']));
}else {
die(json_encode(['result' => 'success']));
}
}