alert를 confirm으로 바꿀수 있나요? 정보
alert를 confirm으로 바꿀수 있나요?본문
update 파일의 밑부분에 있는 alert 인데요..
alert("수정했습니다., "{$https_url}/bbs/board.php?bo_table=$bo_table&page=$page" . $qstr);
이걸...
confirm으로 바꾸어 확인을 클릭하면 일정 페이지로 이동시키고 취소하면 그냥 그 페이지로 가고..
이렇게 바꿀 수 있나요?
alert("수정했습니다., "{$https_url}/bbs/board.php?bo_table=$bo_table&page=$page" . $qstr);
이걸...
confirm으로 바꾸어 확인을 클릭하면 일정 페이지로 이동시키고 취소하면 그냥 그 페이지로 가고..
이렇게 바꿀 수 있나요?
댓글 전체

자바스크립트 소스를 직접 써주시면 됩니다.
echo "<script> if(confirm('수정했습니다.')) { // 확인누른후 실행되는 소스 삽입 } else { // 취소 누르면 실행되는 소스 삽입 }</script>";
echo "<script> if(confirm('수정했습니다.')) { // 확인누른후 실행되는 소스 삽입 } else { // 취소 누르면 실행되는 소스 삽입 }</script>";
function confirm($msg='', $url='', $next_url='')
{
global $g4;
if (!$msg) $msg = '올바른 방법으로 이용해 주십시오.';
@header("Content-Type: text/html; charset=$g4[charset]");
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=$g4[charset]\">";
echo "<script type='text/javascript'>var result =confirm('$msg');";
echo "if(result && !!'$next_url'==true) { location.replace('$next_url'); }else {";
if (!$url)
echo "history.go(-1);";
else
echo "location.replace('$url');";
echo " } ";
echo "</script>";
exit;
}
/lib/common.lib.php 에 넣어 주시고 사용하면 될것 같네요
{
global $g4;
if (!$msg) $msg = '올바른 방법으로 이용해 주십시오.';
@header("Content-Type: text/html; charset=$g4[charset]");
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=$g4[charset]\">";
echo "<script type='text/javascript'>var result =confirm('$msg');";
echo "if(result && !!'$next_url'==true) { location.replace('$next_url'); }else {";
if (!$url)
echo "history.go(-1);";
else
echo "location.replace('$url');";
echo " } ";
echo "</script>";
exit;
}
/lib/common.lib.php 에 넣어 주시고 사용하면 될것 같네요
두분 모두 진심으로 감사드립니다.