개발관련
PHP id 혹은 닉네임 체크
<OOO>
2020. 8. 30. 19:58
728x90
<?php
include_once"./board/dbconf.php";
$con = mysqli_connect($db_host,$db_user,$db_pw,$db_db);
$id = mysqli_real_escape_string($con,$_GET["id"]);
$sql = "select * from users where id='".$id."'";
$result = mysqli_query($con, $sql);
$member = mysqli_fetch_array($result);
if($member==0)
{
?>
<div style='font-family:"malgun gothic"';><?php echo $id; ?>는 사용가능한 아이디입니다.</div>
<?php
}else{
?>
<div style='font-family:"malgun gothic"; color:red;'><?php echo $id; ?>중복된아이디입니다.<div>
<?php
}
?>
<button value="닫기" onclick="window.close()">닫기</button>
<script>
</script>