값을 다른페이지로 보내는 법 질문입니다. 채택완료
제가 아래처럼 코딩을 했습니다..
그러면 여러개의 박스가 생기고 그 안에 "수정" 이라는 단추가 생깁니다..
수정을 누르고 오케이를 누르면 해당 박스 데이타 wr_no 값이 test.php 로 넘어가게 하려고 합니다..
페이지를 여는것 까지는 했는데...값을 어떻게 보내는 건지 질문 드립니다..
$sql = " select * from g5_write_10102shop order by wr_3 " ;
$x = sql_query($sql);
for ($i=1; $row = sql_fetch_array($x); $i++) {
?>
|
} ?>
function delivery_ok(){
yx1 = confirm("배송을 완료 하겠습니까?");
if(yx1 == true){
window.open('test.php', 'test', 'left=100,top=100,width=620,height=510,scrollbars=1');
new_win.focus();
}else{
;
}
}
답변 2개
<span style="font-family: gulim, helvetica; line-height: 23.5440006256104px; background-color: rgb(255, 255, 255);"><a class="btn_b02" onclick=delivery_ok(); >수정</a> </span><span style="font-family: 굴림, Gulim, 돋움, Dotum, Helvetica, sans-serif; line-height: 1.5;"></span><span style="font-family: 굴림, Gulim, 돋움, Dotum, Helvetica, sans-serif; line-height: 1.5;">
이 부분에 javascript function으로 $wr_no를 넘겨주도록 해주고
</span><span style="font-family: gulim, helvetica; line-height: 23.5440006256104px; background-color: rgb(255, 255, 255);"><a class="btn_b02" onclick=delivery_ok(<?php echo $row[wr_no]; ?>); >수정</a> </span><span style="line-height: 1.5; font-family: 굴림, Gulim, 돋움, Dotum, Helvetica, sans-serif;"></span><span style="line-height: 1.5; font-family: 굴림, Gulim, 돋움, Dotum, Helvetica, sans-serif;">
자바스크립트 부분은 이렇게
</font></p><p><font face="굴림, Gulim, 돋움, Dotum, Helvetica, sans-serif"></font><span style="font-family: gulim, helvetica; line-height: 23.5440006256104px; background-color: rgb(255, 255, 255);"> <script></span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);">function delivery_ok(wr_no){</p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);">yx1 = confirm("배송을 완료 하겠습니까?");</p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);">if(yx1 == true){</p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);"><span class="Apple-tab-span" style="white-space: pre;"> </span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);"><span class="Apple-tab-span" style="white-space: pre;"> </span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);">window.open('test.php?wr_no=' + wr_no, 'test', 'left=100,top=100,width=620,height=510,scrollbars=1');</p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);"> new_win.focus();</p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);"><span class="Apple-tab-span" style="white-space: pre;"> </span></p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);"> </p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);">}else{</p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);">;</p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);"> }</p><p style="line-height: 23.5440006256104px; word-break: break-all; font-family: gulim, helvetica; background-color: rgb(255, 255, 255);"> }</p><p><span style="font-family: gulim, helvetica; line-height: 23.5440006256104px; background-color: rgb(255, 255, 255);"></script> </span><font face="굴림, Gulim, 돋움, Dotum, Helvetica, sans-serif">
</font></p><p><font face="굴림, Gulim, 돋움, Dotum, Helvetica, sans-serif">
해주심 되지 않을까 싶네요. ^^
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
GET 으로 넘기려면
test.php?var=value
와 같은 방식으로 넘기며됩니다.
여러개 넘기려면
test.php?var1=value1&val2=value2
위와 같이 &로 연결하면 됩니다.
답변에 대한 댓글 2개
하지만...for 문으로 여러개의 버튼이 생겼고,,각각 다른 id 값이 있는데...
수정을 누르면 해당 id 값이 전송되게 하려고 합니다..
그건 어떻게 하나요..
하지만 채택을 한개 뿐이라....조금더 상세하게 설명해 주신 윗분에게 채택을 드렸습니다..
죄송합니다..
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인