GET 요청 보내기
본문
latest 일부 발췌
<div class="gall_file">
<button class="file_sp" onclick="folder()"><img
src="<?= G5_THEME_IMG_URL ?>/folder_icon_on.png" alt=""></button>
</div>
<?php $folder = G5_BBS_URL . '/folder.php?wr_id=' . $list[$i]['wr_id'] ?>
</div>
</div>
</li>
<?php } ?>
<?php if ($list_count == 0) { //게시물이 없을 때 ?>
<li class="empty_li">게시물이 없습니다.</li>
<?php } ?>
</ul>
<script>
function folder() {
let folder = window.open('<?=$folder ?>', 'folder', 'left=100,top=100,width=450, height=600, scrollbars=0,toolbar=0,location=0,resizable=0,status=0,titlebar=0');
console.log(<?= $folder?>)
folder.focus();
}
</script>
get 요청 들어온거 보면 array(1) { ["wr_id"]=> string(1) "1" } 1만 뜨더군요 .. ㅠㅠ
script를 for문에다가 집어 넣으면 안될거 같고 ...
이럴땐 어떻게 해야될까여??
!-->답변 2
적어주신 구문에 GET 으로 받는 부분은 전혀 없습니다
<?php $folder = G5_BBS_URL . '/folder.php?wr_id=' . $list[$i]['wr_id'] ?>
처럼 folder 이라는 변수가 이미 서버 단계에서 생성이 되어있고 (GET 과 상관없음)
그후에
let folder = window.open('<?=$folder ?>', 'folder', 'left=100,top=100,width=450, height=600, scrollbars=0,toolbar=0,location=0,resizable=0,status=0,titlebar=0');
이런식으로 script 에서 folder 을 사용하고 있습니다
get 으로 요청을 받아서 처리한다는 것은
서버단계에서 처리를 한다는 의미로 받아들이셔야 합니다
1. 브라우져 에서 GET 형태로 요청
2. 서버에서 프로그램 처리 (ex. php 등)
3. 사용자 화면에 출력 (이후 script등의 처리가 일어납니다)
원하시는 게 무엇인지 모르겠네요.
서버에서 php가 실행이 끝나면
그 결과를
브라우저가 받습니다.
그 결과 안에는 html, javascript 등등이 있습니다.
답변을 작성하시기 전에 로그인 해주세요.