인스톨시 기존 데이터베이스가 존재하는지 체크과정 추가
This commit is contained in:
@ -17,6 +17,9 @@ if (!isset($_POST['agree']) || $_POST['agree'] != '동의함') {
|
||||
echo "<div class=\"inner_btn\"><a href=\"./\">뒤로가기</a></div></div>".PHP_EOL;
|
||||
exit;
|
||||
}
|
||||
|
||||
$tmp_str = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '';
|
||||
$ajax_token = md5($tmp_str.$_SERVER['REMOTE_ADDR'].$_SERVER['DOCUMENT_ROOT']);
|
||||
?>
|
||||
|
||||
|
||||
@ -66,6 +69,7 @@ if (!isset($_POST['agree']) || $_POST['agree'] != '동의함') {
|
||||
|
||||
<table class="ins_frm">
|
||||
<caption>최고관리자 정보입력</caption>
|
||||
<input type="hidden" name="ajax_token" value="<?php echo $ajax_token; ?>" >
|
||||
<colgroup>
|
||||
<col style="width:150px">
|
||||
<col>
|
||||
@ -108,6 +112,7 @@ if (!isset($_POST['agree']) || $_POST['agree'] != '동의함') {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../js/jquery-1.8.3.min.js"></script>
|
||||
<script>
|
||||
function frm_install_submit(f)
|
||||
{
|
||||
@ -168,6 +173,29 @@ function frm_install_submit(f)
|
||||
f.admin_id.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (window.jQuery) {
|
||||
|
||||
var jqxhr = jQuery.post( "ajax.install.check.php", $(f).serialize(), function(data) {
|
||||
|
||||
if( data.error ){
|
||||
alert(data.error);
|
||||
} else if( data.exists ) {
|
||||
if( confirm(data.exists) ){
|
||||
f.submit();
|
||||
}
|
||||
} else if( data.success ) {
|
||||
f.submit();
|
||||
}
|
||||
|
||||
}, "json");
|
||||
|
||||
jqxhr.fail(function(xhr) {
|
||||
alert( xhr.responseText );
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user