codeigniter NetworkError:POST操作后找不到404

时间:2014-06-17 19:38:57

标签: php forms codeigniter post

我正在开发一个codeigniter项目。在一个页面上我有一个表格(登录),一个工作正常。但现在我有一个表单来更新我的数据库,但我得到一个NetworkError:404 Not Found(在firebug中)。

这是我的表格

<form action="<?php echo base_url(); ?>cms/activiteit/saveNew" method="post">
<div class="row">
    <div class="col-md-3">Titel:</div>
    <input class="col-md-9" type="text" name="title"/>
</div>
<div class="row">
    <div class="col-md-3">Datum:</div>
    <input class="col-md-9" type="date" name="date" id="date"/>
</div>
<div class="row">
    <div class="col-md-3">Korte beschrijving:</div>
    <input class="col-md-9" type="text" name="short"/>
</div>
<div class="row">
    <div class="col-md-3">Lange beschrijving:</div>
    <textarea class="col-md-9" type="text" name="long"></textarea>
</div>
<div class="row">
    <div class="col-md-12 spatie"></div>
</div>
<div class="row">
    <input type="submit" class="col-md-9 col-md-offset-3 btn btn-info" value="Opslaan"/>
</div>

这是我的控制器

public function saveNew()
{
    if(isset($_POST))
    {
        echo "test";

        $acti = new Activiteiten();

        $acti->title = $this->input->post('title');
        $acti->date = $this->input->post('date');
        $acti->short = $this->input->post('short');
        $acti->long = $this->input->post('long');
        $acti->save();
    }
    else 
    {
        echo 'no post'; 
    }
}

当我查看firebug上的post值时,输入字段中的所有数据都存在,但我无法显示,或者在数据库中插入它。

firebug header:

HTTP/1.1 404 Not Found
Date: Tue, 17 Jun 2014 19:27:40 GMT
Server: Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_bwlimited/1.4
X-Powered-By: PHP/5.4.27
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
POST /cms/activiteit/saveNew HTTP/1.1
Host: perdje.be
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: nl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: http://perdje.be/cms/activiteit/add
Cookie: cprelogin=no; cpsession=perdje1q%3aiLdNSXOGrC7JqfYiwXW5ZEgZzOV7w7Yu0Cs36PnP0Jq__JK7958XQpEYD6tHRNrB%2c01946c78c16598ea1c0c6c7ff8917d333105a9eae2e7fbc65887fd48c550de8b; langedit=; lang=
Connection: keep-alive
Cache-Control: max-age=0

如果有人看到我做错了请求让我知道。我尝试更改我的.htacces,配置文件形式codeigniter,显示发布数据的不同方式,试图显示一些发布数据。但没有任何效果。请帮忙

0 个答案:

没有答案