我已經嘗試了一切,而且我已經接近放棄了。請幫助。codeigniter 302發現錯誤
我一直在努力擺脫codeigniter中的index.php,並且已經完成了谷歌已經提供的每個代碼,都放在.htaccess中。
目前,我有這個。
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
這個工作,但我每次提交表單的時候,我回來這美妙的302錯誤讓我發瘋了。
在我的控制器我提交功能的一個......其他基本上是爲其他形式相同。我已經嘗試了刷新和重定向的位置方法,但是沒有任何改變。我不相信這是問題。
public function submitStory(){
if (empty($this->user)) {
redirect('/home/');
}else{
$this->story_model->writeStory();
redirect('story/newChapterView/');
}
}
我的模型只是插入數據庫
public function writeStory(){
$this->title = strip_tags($this->input->post('wTitle'));
$this->date = time();
$this->author = strip_tags($this->input->post('wAuthor'));
$this->type = strip_tags($this->input->post('wType'));
$this->db->insert('story_tbl', $this);
}
我的形式之一,他們非常簡單,只是一個標準的笨形式
<?=form_open('story/submitStory', array('id' => 'newStory'));?>
<p class="textBox"><label>Story Title: </label><input id="storyTitle" type="text" name="wTitle" autocomplete="off" /></p>
<p><label>Complete:</label><select class="drop" name="wcomplete" id="complete"><option value="no">no</option><option value="yes">yes</option></select></p>
<p><label>Description: </label><textarea name="wDescription" id="wDescription" class="wDescription"></textarea><span id="discWarn">500 characters left</span></p>
<p class="submit"><input type="submit" value="Submit Details" /></p>
</form>
你假設的問題是與重定向 「AUTO」 - 但如果它只發生在表單上,也許檢查它們?什麼是爲表格生成的HTML?它要發佈什麼網址? – Stobor
我在上面添加了一個表單。您發佈的網址的含義是什麼? – zazvorniki