p

경고창 후 페이지 이동과 동시에 팝업창 띄우기

아래는 update.php 내용의 일부 입니다.

alert("상담이 신청되었습니다.", "{$g4[path]}/");

이렇게 되면 경고창 뜨고 홈페이지 첫화면으로 이동합니다.

구현하고 싶은것은?

페이지 이동과 동시에 팝업창을 띄우려고 하는데 어떻게 해야 할까요?

댓글 5개

die("<script type=text/javascript>alert("상담이 신청");window.open(띄울창-이건네이버쳐보면많이나와요);location.href='http://gnucomun.net/';</script>");
http://blog.naver.com/jasonbae6/20059429108
<?
include_once("./_common.php");

alert('상담이 신청'); window.open(menu_win); location.href='{$g4[path]}/';
?>

이렇게 했는데 안되네요?
<?
include_once("./_common.php");

echo "<script>alert('상담이 신청'); window.open(menu_win); location.href='{$g4[path]}/'; </script>";
?>


그리고 menu_win이라는 변수에 주소가 정의되어있나요?
/lib/common.lib.php 에서
function alert($msg='', $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 language='javascript'>alert('$msg');";
if (!$url)
echo "history.go(-1);";
echo "</script>";
if ($url)
// 4.06.00 : 불여우의 경우 아래의 코드를 제대로 인식하지 못함
//echo "<meta http-equiv='refresh' content='0;url=$url'>";
goto_url($url);
exit;
}


이렇게 된 부분을 살펴보세요. 그래야 이해가 되실 것 같네요.
간단하게 update.php를

alert("상담이 신청되었습니다.", "{$g4[path]}/?popup=yes");

이런식으로 수정한 후 index.php 파일에

if ($popup == 'yes') {

팝업 코드

}

이렇게 하시면 될 것 같은데요...
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
09-12-07 조회 1,053
09-12-06 조회 1,830
09-12-06 조회 2,756
09-12-06 조회 1,246
09-12-06 조회 1,114
09-12-06 조회 924
09-12-06 조회 1,451
09-12-06 조회 4,570
09-12-06 조회 1,601
09-12-06 조회 1,660
09-12-06 조회 1,245
09-12-06 조회 1,644
09-12-06 조회 1,648
09-12-06 조회 1,603
09-12-06 조회 1,775
09-12-06 조회 1,128
09-12-06 조회 1,053
09-12-06 조회 889
09-12-05 조회 1,970
09-12-05 조회 1,731