셀렉트박스 페이지이동 되게 해주세요.. > 그누4 질문답변

그누4 질문답변

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

셀렉트박스 페이지이동 되게 해주세요.. 정보

셀렉트박스 페이지이동 되게 해주세요..

본문

<?
$g4_path = ".."; // 상대 경로
include_once ("$g4_path/common.php");
include_once("$g4[path]/lib/latest.lib.php");
include_once("$g4[path]/lib/outlogin.lib.php");

/* 비공개일 경우 이것을 제거함
if (!$member[mb_id])
    alert_close("회원만 사용할 수 있습니다!");
*/

// 현재 보고있는 회원의 아이디가 없을경우 본인의 아이디로 돌아감
if($mb_id == "") { $mb_id = $member[mb_id]; }
include_once("./mini_head.php");
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title><?=$nick?>님 미니홈 : <?=$mtitle?></title>
<style type="text/css">
<!--
BODY,TD,input,DIV,form,TEXTAREA,center,pre,blockquote {font-size:9pt;font-family:tahoma,굴림;color:#000000;}
.line    { background-color:#B5AACD; height:1px;}
a:visited {text-decoration:none; color:#333333;}
a:link {text-decoration:none; color:#333333;}
a:hover {text-decoration:none; color:#333333;}
.base {border:0 solid #8FA8D0;}
.on {border-style:solid; border-width:1; border-color:#B2C3DE #577BB7 #577BB7 #B2C3DE;}
.down {border-width:1; border-style:solid; border-color:#577BB7 #B2C3DE #B2C3DE #577BB7; padding:2 0 0 2}
-->
</style>

<script language="JavaScript">
<!--
function fmember_submit(f){
ck = f.options[f.options.selectedIndex].value;
location.href = "./index.php?mb_id="+ck;
}
function f2member_submit(f){
ck = f.options[f.options.selectedIndex].value;
location.href = "./index.php?mb_id="+ck;
}
-->
</script>

<SCRIPT language="javascript">
<!--
Start = new Date()
function loadTIME()
{
Stop = new Date()
Load = Stop.getTime() - Start.getTime();
Load = Load / 1000
window.status=("현재 문서를 로딩하는데에 " + Load + " 초가 걸렸습니다."); // 상태바에 표시되는 메세지
}
-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
function one_view(num)  {
if (num==1) {
document.all.your_one.style.display = "inline";
document.all.all_one.style.display = "none";
document.all.one_img1.src="<?=$g4[path]?>/img/minifeel/a_friends_1.gif";
document.all.one_img2.src="<?=$g4[path]?>/img/minifeel/a_member_0.gif";
} if (num==2) {
document.all.your_one.style.display = "none";
document.all.all_one.style.display = "inline";
document.all.one_img1.src="<?=$g4[path]?>/img/minifeel/a_friends_0.gif";
document.all.one_img2.src="<?=$g4[path]?>/img/minifeel/a_member_1.gif";
}
}
</script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" oncontextmenu="return false" ondragstart="return false" bgproperties=fixed onLoad="loadTIME();">
<table width="980" height="600" border="0" cellpadding="0" cellspacing="0" background="<?=$g4[path]?>/img/minifeel/<?=$mbg?>.jpg">
<tr><td width="100%" height="70"></td></tr>
<tr>
<td width="100%" valign=top>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="46">&nbsp;</td>
<td width="155" valign=top>
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tr>
<td valign=top>
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tr>
<td height="20" valign=top class="base" onMouseOver="this.className='on'" onMouseOut="this.className='base'" onMouseDown="this.className='down' "onMouseUp="this.className='on'" align="center">
<img src="<?=$g4[path]?>/img/minifeel/<?=$man?>.gif" border=0 align="absmiddle">
<a href="./index.php?mb_id=<?=$mb_id?>" onFocus='this.blur()' title='새로고침'> <b><?=$nick?>님</b></a>
</td>
</tr>
<tr><td valign=top class=line></td></tr>
<tr><td valign=top height=10></td></tr>
<tr>
<td valign=top>
<?
$mb_dir = substr($mb_id,0,2);
$phto_file = "$g4[path]/data/member/$mb_dir/($mb_id)_phto.gif";
if (file_exists($phto_file)) {
?>
<table width='155' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='155' height='120' style='border:1px solid #CCCCCC;padding:3px' align='center'><img src='<?=$phto_file?>' width='130' height='110' border='0' align=absmiddle>
</td>
</tr>
<tr><td valign=top height=15></td></tr>
</table>
<?}else if ($avatar=="yes") {/* 수정하지마세요 */ ?>
<table width='140' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td valign='top' width='140' height='160' align='center' style='border:1px solid #CCCCCC;padding:3px' align='center'>
<iframe src="<?=$g4[path]?>/avatar/avatar_view.php?m_id=<?=$mb_id?>" width="120" height="160" frameborder="0" marginwidth="0" marginheight="0" topmargin="0" scrolling="no"></iframe>
</td>
</tr>
</table>
<?}else{?>
<table width='140' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td valign='top' width='140' height='160' align='center' style='border:1px solid #CCCCCC;padding:3px' align='center'>
<img src="<?=$g4[path]?>/img/minifeel/no_image.gif" width="130" height="110" border='0' align=absmiddle></div>
</td>
</tr>
<tr><td valign=top height=5></td></tr>
</table>
<?}?>
</td>
</tr>
<tr><td valign=top height=4></td></tr>
<tr><td height=1 bgcolor=E7E7E7></td></tr>
<tr><td valign=top height=5></td></tr>
</table>
</td>
</tr>
<tr><td width=155 valign=top align=center>
<?=latest_schedule("minifeel_calendar","diary"); //달력?>
<!--
<iframe name="left" width="100%" height=180 frameborder="0" topmargin="0" marginheight=0 marginwidth=0 scrolling=no src="./calendar.php"></iframe>
-->
</td></tr>
<tr><td valign=top height=5></td></tr>
<? if (!$member[mb_id]) {?>
<tr><td valign=top height=5></td></tr>
<tr><td valign=top height=10 align=center><?=outlogin("tech");?></td></tr>
<? } else { ?>
<tr><td valign=top height=3></td></tr>
<tr><td>
<TABLE height=21 cellSpacing=0 cellPadding=0 width="100%" border=0>
                  <TBODY>
                    <TR>
                    <TD width=71 background=<?=$g4[path]?>/img/minifeel/a_bg.gif>
                      <A onfocus=blur() href="#" onclick="void(one_view('1'))"><IMG id=one_img1 height=21 src="<?=$g4[path]?>/img/minifeel/a_friends_1.gif" border=0 width=35></A><A onfocus=blur() href="#" onclick="void(one_view('2'))"><IMG id=one_img2 height=21 src="<?=$g4[path]?>/img/minifeel/a_member_0.gif" border=0 width=36></A>
                      </TD>
                      <TD valign=top width=69 background=<?=$g4[path]?>/img/minifeel/a_bg.gif>
                      <a href='./index.php?mb_id=<?=$member[mb_id]?>' title='나의홈 바로가기'><img src="<?=$g4[path]?>/img/minifeel/man0.gif" align="absmiddle" border=0>My Home</a>
                      </TD>
                    </TR>
                  </TBODY>
                  </TABLE>
</td></tr>
<tr><td valign=top align=center>
  <table width='155' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<FORM NAME=fmember>
<td width='60' valign=top align=center>
      <SELECT id=your_one name=friend onchange="fmember_submit(this)" style="WIDTH: 155px; BACKGROUND-COLOR: #f4f4f4">
      <OPTION selected>◆ 등록친구 (<?=$FriendTotal?>명)
                <?
    if($mb_id == $member[mb_id] || $fr_open == 1 ) {
        for ($i=0; $FriendTotal>$i; $i++) {
    $sql = " select * from $g4[member_table] where mb_id='$arry_friend[$i]'";
    $result = sql_query($sql);
    $f_info = sql_fetch_array($result);
    $nick = cut_str(get_text($f_info[mb_nick]), 16);
                echo"<OPTION value=$f_info[mb_id] 'selected'>$f_info[mb_nick]";}
                } else { 
                  echo"<OPTION value=''>-- 비공개 --";
                  }
                ?>
                </SELECT></td></FORM>
<form name=f2member>
<td align=absmiddle valign=middle background=<?=$g4[path]?>/img/minifeel/1wav_bg2.gif>
    <select id=all_one name=member onChange="f2member_submit(this)" style="DISPLAY: none; WIDTH: 155px; BACKGROUND-COLOR: #f4f4f4">
    <?
    $sql = " select * from $g4[member_table]";
    $result = sql_query($sql);
    for ($i=0; $mb_row = sql_fetch_array($result); $i++) {
    $nick = cut_str(get_text($mb_row[mb_nick]), 16);
    ?>
    <option value="<?=$mb_row[mb_id]?>"<?if($mb_row[mb_id] == $mb_id)echo' selected';?>><?=$nick?></option>
    <?}?>
    </select></td></form>
</table></td></tr>
<?}?>
</table>
</td>
<td width="30">&nbsp;</td>
<td width="540">
<iframe name="main" frameborder="0" height="457" width="100%" onload="contentWindow.document.body.style.overflowX='hidden'" marginheight=0 marginwidth=0 src="./myhome.php?mb_id=<?=$mb_id?>"></iframe> <!--가로스크롤바 안생기게 처리-->
</td>
<td width="50"><!-- 옆의 메뉴부분-->
<div id="layer2" style="width:50px; height:300px; position:absolute; left:785px; top:67px; z-index:1;">
<table id="menu" width="50" border="0" cellpadding="0" cellspacing="0">
<tr><td><A href='./myhome.php?mb_id=<?=$mb_id?>&icon=<?=$man?>' target=main><img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu1.gif' alt='처음으로' border=0></a></td></tr>
<tr><td height=4></td></tr>
<tr><td>
<A href='<?=$g4[path]?>/bbs/board.php?bo_table=mybbs&sca=<?=$mb_id?>&bbs=<?=$bbs?>' target=main>
<img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu2.gif' alt='<?=$bbs_title?>' border=0></a></td></tr>
<tr><td height=4></td></tr>
<? if($bbs_buy == 1) { ?>
<tr><td>
<A href='<?=$g4[path]?>/bbs/board.php?bo_table=mybbs2&sca=<?=$mb_id?>&bbs2=<?=$bbs2?>' target=main>
<img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu9.gif' alt='<?=$bbs2_title?>' border=0></a></td></tr>
<tr><td height=4></td></tr> <? } ?>
<? if($m_phto == 1 || $bbs_phto == 1) { ?>
<tr><td>
<A href='<?=$g4[path]?>/bbs/board.php?bo_table=myphto&sca=<?=$mb_id?>&phto=<?=$phto?>' target=main>
<img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu3.gif' alt='<?=$phto_title?>' border=0></a></td></tr>
<tr><td height=4></td></tr>
<? } ?>
<? if($m_scrib == 1 || $bbs_scrib == 1) { ?>
<tr><td>
<A href='<?=$g4[path]?>/bbs/board.php?bo_table=mybook&sca=<?=$mb_id?>&icon=<?=$man?>' target=main>
<img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu4.gif' alt='미니낙서장' border=0></a></td></tr>
<tr><td height=4></td></tr>
<? } ?>
<? if($m_music || $bbs_music == 1) { ?>
<tr><td>
<? if($open_music == 1) { ?>
<A href='<?=$g4[path]?>/bbs/board.php?bo_table=mymusic' target=main>
<img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu5.gif' alt='음악/동영상' border=0></a>
        <? } else { ?>
        <A href='<?=$g4[path]?>/bbs/board.php?bo_table=mymusic&sca=<?=$mb_id?>&icon=<?=$man?>' target=main>
        <img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu5.gif' alt='음악/동영상' border=0></a>
        <? } ?>
        </td></tr>
        <? } ?>
<? if($mb_id == $member[mb_id]){?>
<tr><td>
<A href='./bio.html' target=main><img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu7.gif' alt='나의 바이오리듬' border=0></a></td></tr>
        <tr><td height=4></td></tr>
<tr><td>
        <A href='<?=$g4[path]?>/bbs/board.php?bo_table=diary' target=main><img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu6.gif' alt='나의 일정관리' border=0></a></td></tr>
<tr><td height=4></td></tr>
<tr><td>
<a href='./cfg.skin.php?$mb_id=<?=$mb_id?>&icon=<?=$man?>' target=main>
<!--
<a href="#" onClick="javascript:void(window.open('./cfg.skin.php?$mb_id=<?=$mb_id?>&icon=<?=$man?>','cfg','width=400,height=450,menubar=no,scrollbars=1'));">
-->
<img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu0.gif' alt='홈피환경설정' border=0></a>
</td></tr>
<? if($logout_btn == 1) { ?>
<tr><td height=4></td></tr>
<tr><td><a href='./logout.php'><img src='<?=$g4[path]?>/img/minifeel/<?=$mu?>_mu8.gif' alt="로그아웃" border=0></a></td></tr>
<? } } ?>
<? if($mbg == "bg11"){?>
<tr><td height=4></td></tr>
<tr><td><img src='<?=$g4[path]?>/img/minifeel/flag.gif' alt="태극기" border=0></td></tr>
<? } ?>
</table>
</div>
</td>
<td width="">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr><td width="100%"></td></tr>
</table>
</body>
</html>
 ----------------------------------------------------------------------------------------

셀렉트로 된 등록친구란을 클릭하여 등록된 친구 클릭하였을때 페이지로 넘어가지지가 않네요...
그냥 일판 웹페이지에서는 잘 넘어가 지는데... 로컬프로그램에서는 안되네요... 로컬프로그램에 적용중인데... 플렉스와 어도비에어가 사용된 프로그램이거든요...

클릭했을때 페이지만 바뀌면 됩니다... 로컬 프로그램용으로 소스를 바꿔야 하는거 같은데 어떻게 해야 될지 모르겠습니다...가르쳐 주세요...
  • 복사

댓글 전체

문제 상황이 어떤 상황인지 제대로 설명이 안되어있습니다.

플렉스와 어도비에어가 왜 나오는지 그  쪽으로 이동되라는 말인지
(대충보니 전혀관련없어 보이긴 합니다만 )

지금 기존 구조 보시면
select 태그에
onchange="fmember_submit(this)"
가 있어서 변경시마다 해당 함수가 호출 되고
조금 위에 보시면
function fmember_submit(f){
ck = f.options[f.options.selectedIndex].value;
location.href = "./index.php?mb_id="+ck;
}
이 함수가 호출이 되는 겁니다.
function fmember_submit(f){
alert(f);
alert(f.options);
alert(f.options.selectedindex);
ck = f.options[f.options.selectedIndex].value;
alert(ck);
location.href = "./index.php?mb_id="+ck;
}

이렇게 해당 변수값들이 제대로 넘어오는지 한번 확인해주시고
어디가 문제인지 파악해보시길 바랍니다
function fmember_submit(f){
alert(f);
alert(f.options);
alert(f.options.selectedindex);
ck = f.options[f.options.selectedIndex].value;
alert(ck);
location.href = "./index.php?mb_id="+ck;
}
---------------------------------------
몽구스님, 써주신대로 넣어서 셀렉트 선택해 보니까...
1. [object HTMLSelectElement]
2. [object HTMLOptionsCollection]
3. [undefined]
4. 4번째는 mb_id값(셀렉트 선택값)이 나오네요.

어떻게 하면 될까요?;; 한번만더 도와주시면 안될까요?;;
아직도 페이지 변경은 안되네요...;;
그럼  해당 스크립트 함수 호출까진 정상적으로 이루어지는 것 같습니다

작업하시는 환경에서
location.href = "./index.php?mb_id="+ck;  이 부분이 동작하지 않는 것 같습니다.
사용하시는 브라우저 + OS + 환경 말씀해주시면 저한테도 도움이 될 것 같습니다.

주소창에 javascript:alert(location.href); 한번 쳐보시고
주소창에 javascript:alert(location.href = 'http://google.com'); 해서 페이지 이동되나 보시고요

location.href 말고
document.location.href 이라고 쓰시거나
document.location 이라고도 한번 써보세요


중간중간에 비 표준 문법이 많이 보입니다
(document.all 이라든가)
jQuery 공부도 한번 해보시는 것도 좋을 것 같습니다.
익스플로러 주소창을 말씀하시는거 같아서...일반웹에서는 javascript:alert(location.href);, javascript:alert(location.href = 'http://google.com'); 다 잘됩니다.
근데 소스 사용되는곳이 프로그램이라;; 어도비에어로 만들어졌거든요...
(xp, 익스8 입니다.)
문제 상황 설명을 이제야 했네요 -_-;
해당 HTML이  어도비에어 내부에서 돌아간다는 거군요.

그러니까
어도비에어 (일종의 브라우저 역할) 에서
location.href 를 지원안할 수도 있으니까

document.location.href 이나
document.location 으로 바꿔보시라는 거고요

location.replace 였던가 그런 방법도 있고요
© SIRSOFT
현재 페이지 제일 처음으로