CI 묻고 답하기

제목 모바일 페이지를 만들고 있는데요;
글쓴이 책상다리 작성시각 2013/12/12 15:02:31
댓글 : 3 추천 : 0 스크랩 : 0 조회수 : 12919   RSS
 모바일 페이지에서는 작동이 안되고...
웹에서 작동이 될때는 어디에 문제점이 있을까요;;
마이페이지를 만들어봤는데, 정보를 불러와서 잘 출력은 되는데, 정보를 고쳐서 수정 버튼을 누르면, 웹에서는 수정이 되는데, 모바일에서는 전혀 수정이 안되네요;;
저번처럼 undefined 메세지가 뜨는것도 아니고, 그냥 화면이 깜빡 거리고 말더군요;
 
웹에서 작동 되는걸 보면 소스에 이상은 없는거 같기도 한데...
일단 컨트롤러 쪽을 올려봅니다 ㅠ

 
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowd');

class Mypage extends CI_Controller {

 function __construct()
 {
  parent::__construct();
    $this->load->database();
    $this->load->model('mypage_m');
    $this->load->helper('alert');
    $this->load->helper('form');  
 }

 public function index()
 {
  $this->mypage();
 }

 public function _remap($method)
 {
  if( BROWSER_TYPE == 'W' )
  {
   $this->load->view('header_v');

   if( method_exists($this, $method) )
   {
    $this->{"{$method}"}();
   }

   $this->load->view('footer_v');
  }
  else if( BROWSER_TYPE == 'M' )
  {
   $this->load->view('mobile_header_v');

   if( method_exists($this, $method) )
   {
    $this->{"{$method}"}();
   }
   $this->load->view('mobile_footer_v');
  }
 
 }

 public function mypage()
 {
  if(@$this->session->userdata['logged_in'] == TRUE )
  {
   $ID=@$this->session->userdata['ID'];

   $data['member'] = $this->mypage_m->get_member('member',$ID);
   
   if ( BROWSER_TYPE == 'M' )
   {
    $this->load->view('mobile_mypage_v',$data);
   }
   else
   {
    $this->load->view('mypage_v',$data);
   }

   //폼 검증 라이브러리 로드
   $this->load->library('form_validation');

   //폼 검증할 필드와 규칙 사전 정의
   $this->form_validation->set_rules('name', '이름', 'required');
   $this->form_validation->set_rules('email', '이메일', 'required');
   $this->form_validation->set_rules('post_1', '우편번호', 'required');
   $this->form_validation->set_rules('post_2', '우편번호', 'required');
   $this->form_validation->set_rules('addr1', '주소', 'required');
   $this->form_validation->set_rules('addr2', '주소', 'required');
   $this->form_validation->set_rules('tel1', '전화번호', 'required');
   $this->form_validation->set_rules('tel2', '전화번호', 'required');
   $this->form_validation->set_rules('tel3', '전화번호', 'required');
   $this->form_validation->set_rules('hp1', '핸드폰', 'required');
   $this->form_validation->set_rules('hp2', '핸드폰', 'required');
   $this->form_validation->set_rules('hp3', '핸드폰', 'required');

   if ( $this->form_validation->run() == TRUE )
   {
    // var dump($_POST);
    $modify_data = array(
     'table' => 'member',
     'memb_idx' => $this->input->post('memb_idx', TRUE),
     'name' =>  $this->input->post('name', TRUE),
     'email' => $this->input->post('email', TRUE),
     'post_1' => $this->input->post('post_1', TRUE),
     'post_2' => $this->input->post('post_2', TRUE),
     'addr1' => $this->input->post('addr1', TRUE),
     'addr2' => $this->input->post('addr2', TRUE),
     'tel1' => $this->input->post('tel1', TRUE),
     'tel2' => $this->input->post('tel2', TRUE),
     'tel3' => $this->input->post('tel3', TRUE),
     'hp1' => $this->input->post('hp1', TRUE),
     'hp2' => $this->input->post('hp2', TRUE),
     'hp3' => $this->input->post('hp3', TRUE)
    );

    $result = $this->mypage_m->modify_mypage($modify_data);
    
    if ( $result )
    {
     //글 작성 성공시 목록으로
     alert('수정되었습니다.','/main');
     exit;   
    }
    else
    {
     //글 수정 실패시
     alert('다시 수정해주세요.','/mypage');
     exit;
    }
   }
  }
  else
  {
   $rpath = str_replace("index.php/", "", $this->input->server('PHP_SELF'));
   $rpath_encode = url_code($rpath, 'e');   
   echo "<script>alert('로그인 후 보실수 있습니다.');
   document.location = '/auth/login/$rpath_encode';
   </script>";
   exit;
  }
 }
}
 다음글 md5 적용 중 코드 에러 (3)
 이전글 안녕하세요 선배님들 도와주세요 (3)

댓글

한대승(불의회상) / 2013/12/12 15:22:20 / 추천 0
프로파일러를 켜고 테스트 해보세요.
$this->output->enable_profiler();
모바일 테스트를 하실때는 사파리나 크롬, 파이어폭스 확장 프로그램중 모바일 브라우져로 user agent를 바꿔서 테스트를 하시면 편하게 디버깅이 가능합니다.
변종원(웅파) / 2013/12/12 15:23:10 / 추천 0
작동 안하는 모바일 뷰파일과 헤더파일이 필요합니다. ^^
책상다리 / 2013/12/12 15:42:03 / 추천 0
 한대승님 // 감사합니다. 책에서 봤었는데 이걸 까먹고 있었다니...
$this->output->enable_profiler(TRUE); 이렇게 해놓고 보았는데..별 문제가 될만한게 없네요 ㅠㅠ

변종원님 // 감사합니다. 잘 실행되는데, 문제는 문제점이 안보인다는 거군요(__)
좀더 고민해봐야겠습니다 ㅠㅠ