질문
Q #12611
redirect 문제입니다.
싸이클로크로스
2015-11-09 19:38:30
DB도 정상적으로 입력되고 다 되는데 redirect메소드만 먹지 않네요 머가 문제인걸까요?
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class Main extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->database();
$this->load->model('blog_m');
$this->load->helper('url');
$this->load->helper('date');
}
public function _remap($method){
$this->load->view('header');
if(method_exists($this, $method)){
$this->{"{$method}"}();
}
$this->load->view('footer');
}
public function test(){
$data['blog']=$this->blog_m->read();
$this->load->view('shopinfo',$data);
}
public function viewone(){
$id=$this->uri->segment(3);
$data['vvv']=$this->blog_m->readone($id);
$this->load->view('view_vv',$data);
}
function writeblog(){
if($_POST)
{
$title=$this->input->post('title',true);
$content=$this->input->post('content',true);
$pass=$this->input->post('pass',true);
$username=$this->input->post('username',true);
$cate=$this->input->post('cate',true);
$result=$this->blog_m->insert_blogtable($title,$content,$pass,$username,$cate);
if($result){
redirect('/main/test');
exit;
}
}
else
{
$this->load->view('write_vv');
}
}
}
?>
미치겠습니다 도와주세요