CI 묻고 답하기

제목 저두 session관련 질문..;
글쓴이 케케케 작성시각 2013/02/12 15:51:41
댓글 : 1 추천 : 0 스크랩 : 0 조회수 : 13750   RSS

<?php
class Form extends CI_Controller {
function Form()
    {
        parent::__construct();
 
       
        $this->load->library(array('form_validation','session'));
        $this->_salt = '7e8f9h7t1q';
        $this->load->helper(array('form', 'url'));

    }
 
    function login()
     {
 $this->form_validation->set_rules('id', 'id', 'trim|required'); // 규칙정하는 함수
 $this->form_validation->set_rules('pw', 'pw', 'trim|required|sha1');       
        $this->id = $this->input->post('id');
        $this->pw = sha1($this->_salt . $this->input->post('pw'));
         if ($this->form_validation->run() == false)
         {
             $this->load->view('myform');
         }
         else
         {
             $this->load->view('formsuccess', $data);
         }
     }
     function password_check()
     {
         $this->db->where('id', $this->id);
         $query = $this->db->get('admin');
         $result = $query->row_array();
         if ($result['password'] == $this->password)
         {
             return true;
         }
         if ($query->num_rows() == 0)
         {
             $this->form_validation->set_message('password_check', '틀렷어');
             return false;
         }
     }
}

 

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\APM_Setup\htdocs\application\controllers\form.php:1)

Filename: core/Common.php

Line Number: 442

 

404 Page Not Found

The page you requested was not found.



이렇게 오류 나는데...; 구문에 오류가있나요..?




 

 다음글 모델값을 컨트롤러에 읽는 방법 문의 드립니다. (5)
 이전글 session 관련 질문 드립니다 (3)

댓글

변종원(웅파) / 2013/02/12 17:04:11 / 추천 0
질문하실때 육하원칙 잘 적용하시면 빠른 답변을 얻으실 수 있습니다.
어디서 뭘 하다가 경고가 나왔는지 빠졌습니다.

ci만의 warning은 아니고 세션 작업 전에 echo나 화면출력, 에러가 있으면 저런 화면이 나옵니다.
(php도 동일) 특수한 경우도 있는데 파일을 저장할때 잘못된 포맷으로 저장이 되도 저런 경고가
나올 수 있습니다.