티스토리 뷰
호출부
var _confirm_duplicate = "false";
var newWinURL = "popCheckId.php?identifier=" + pUserID.val();
var newWinName = "IDchk";
var newWinOpt = "width=380, height=200, menubar=no, toolbar=no, location=no, status=no, scrollbars=no, resizeable=no";
window.open(newWinURL, newWinName, newWinOpt);
ajax
$("#_confirm_duplicate").load("popCheckId.php #_confirm_duplicate", complete);
function complete(){
_confirm_duplicate = $("#_confirm_duplicate").text();
}
<div id="_confirm_duplicate" style="display:none"></div>
데이터부
<?php
header("Content-type: text/html;charset=utf-8");
require_once "../include/data.php";
require_once "../lib/library.php";
require_once "../include/head_2.html";
$identifier = $_GET['identifier'];
$identifier 를 DB 쿼리로 처리~~~~했다고 가정
?>
</head>
<body class='popCheckId'>
<form name='fmPopCheck' method='post' action=''>
<input type='hidden' name='identifier' value='<?=$identifier?>' />
<header><h3>아이디 중복확인</h3></header>
<article> <p> <span style='color:green'><?=$identifier?></span> 은 사용할 수 있는 아이디 입니다.</p>
<a href="javascript:self.close();"><input id="btn" type="button" value="확인" size='10' /></a>
<div style="display:none" id='_confirm_duplicate'>true</div>
</article>
</form>
</body>
</html>
'■ 백엔드 ■ > PHP' 카테고리의 다른 글
session 변조방지를 위해 비교할 값은 무조건 IP로 (0) | 2015.01.22 |
---|---|
게시판 기초 기본형 (0) | 2014.10.20 |
setcookie() - 쿠키 생성, 사용, 삭제 (0) | 2014.05.07 |
file_exists (0) | 2014.04.30 |
php isset (0) | 2014.04.30 |