2015-08-25 16 views
0

插入數據我有一個.htaccess文件我的服務器上(使用codeignater)的.htaccess不支持codeignater

這是我的看法頁

<form action='cms/register' method ='post'> 
bla bla bla 
</form> 

和位指示模型大家都知道 的問題是,當我點擊提交沒有發生 但如果我改變窗體的標題是那樣的

<form action='cms/index.php/register' method='post'> 

evreything工程,以便問題來自.htaccess。

我該如何解決?

+0

您好,歡迎來SO,我強烈建議你看一看在[旅遊](http://stackoverflow.com/tour)。如果您確定這是一個.htaccess問題,那麼爲什麼不在您的問題中包含.htaccess代碼? – Epodax

+0

對不起,這是我的htacces –

+0

我是新instackover我不知道該怎麼做 –

回答

0

使用動態網址是這樣的:

$this->load->helper('url'); 

然後形式:

<form action="<?php echo site_url("register"); ?>"> 

如果site_url()不工作,然後嘗試base_url()

更新:

從應用/配置/ config.php文件複製到''$config['index_page']如果你正在使用mod_rewrite改變'index.php'

/* 
|-------------------------------------------------------------------------- 
| Index File 
|-------------------------------------------------------------------------- 
| 
| Typically this will be your index.php file, unless you've renamed it to 
| something else. If you are using mod_rewrite to remove the page set this 
| variable so that it is blank. 
| 
*/ 
$config['index_page'] = 'index.php'; 
+0

我嘗試但不工作 –

+0

是的,我什麼也沒有發生 –