개발 Q&A

제목 이게 왜 안되는걸까요? 뷰 전환~
글쓴이 수야디벨 작성시각 2012/10/23 19:10:15
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 18939   RSS


머리속으로는 분명히 되야 되는게 안되고 있습니다 ㅠ


우선 , 이그니터 구조는 이렇습니다.

controller 폴더 / site.php

<?php
 class Site extends CI_Controller
 {
  function index()
  {
   $this->load->view('result');
  }
  
  function insert()
  {
   $this->load->view('insert');
  }
 }
?>

index()를 실행하기 때문에 바로 views폴더의 result.php 페이지가 실행이 됩니다.


views폴더에는 result.php 와 insert.php 두 종류가 있는데요

result.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>무제 문서</title>
<script type="text/javascript">
function insert(){
 window.open('site/insert','Userinfo','width=600,height=200 ,location=0'); 
}
</script>
</head>

<body>
result
<input type="submit" value="가입" onclick="[removed]insert()" />
</body>
</html>

이렇게 구성되어 있고 버튼을 누르면 자바스크립트로 controller단에 있는 site.php의 insert메서드를 실행하게
되어있습니다.

그래서 insert()메서드가 다시 $this->load->view('insert') 를 실행해서
insert.php 를띄어야 하는데,

페이지를 찾을 수 없다고 나옵니다 .


왜 안되는걸까요~??



//
insert.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>무제 문서</title>
</head>
<body>
<form action="result.php" method="post">
<input type="submit" name="text" size="20" />
</form>
</body>
</html>

 

 다음글 네이버검색어처럼 보이게하기..;; (8)
 이전글 네이버 검색어 (9)

댓글

변종원(웅파) / 2012/10/23 20:00:35 / 추천 0
아파치 로그, ci 로그 보세요 답이 있습니다
한대승(불의회상) / 2012/10/23 20:14:20 / 추천 0
^^

'site/insert' 라고 되어 있는 부분을 '/site/insert' 로 바꿔 보세요.