- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경 - DB 연결 하드코딩 → .env 기반으로 변경 - MySQL strict mode DATE 오류 수정
32 lines
909 B
PHP
32 lines
909 B
PHP
<meta charset="UTF-8">
|
|
<?php $nick = $_REQUEST["nick"];
|
|
if(!$nick)
|
|
{
|
|
print "닉네임을 입력하세요.<p>";
|
|
}
|
|
else
|
|
{
|
|
require_once("../lib/mydb.php");
|
|
$pdo = db_connect();
|
|
|
|
try{
|
|
$sql = "select * from chandj.member where nick = ? ";
|
|
$stmh = $pdo->prepare($sql);
|
|
$stmh->bindValue(1,$nick,PDO::PARAM_STR);
|
|
$stmh->execute();
|
|
$count = $stmh->rowCount();
|
|
} catch (PDOException $Exception) {
|
|
print "오류: ".$Exception->getMessage();
|
|
}
|
|
|
|
if($count<1){
|
|
print "사용가능한 닉네임입니다.<p>";
|
|
} else
|
|
{
|
|
print "닉네임이 중복됩니다.<br>다른 닉네임을 사용해 주세요.<p>";
|
|
}
|
|
}
|
|
print "<center> <input type=button value=창닫기 onClick=self.close()> </center>" ;
|
|
|
|
?>
|