【发布时间】:2012-09-27 07:58:57
【问题描述】:
在 Codeigniter 中,当我使用 form_open() 函数时,它会将 index.php 添加到 url。
如何删除它?
注意:我使用 htaccess 从 url 中删除了 index.php。
【问题讨论】:
标签: php forms codeigniter
在 Codeigniter 中,当我使用 form_open() 函数时,它会将 index.php 添加到 url。
如何删除它?
注意:我使用 htaccess 从 url 中删除了 index.php。
【问题讨论】:
标签: php forms codeigniter
你可以对 form_open() 进行操作,像这样
form_open(base_url().'your_controller_name/function_name');
【讨论】:
form_open(base_url('your_controller_name', 'function_name'));实际上会更合适
您没有从 $config['index_page'] = "index.php"; 中删除 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';
$config['index_page'] = '';
【讨论】: