表单操作URL错误


Form action URL error

我有一个这样的表单:

<?php
    echo form_open('/student/insert',array('name' => 'myform');
?>
// form data like label, input tags
// submit button
<?php 
     echo form_close();
?>

我有一个URL,它显示了这个表单:

http://localhost/mycodeigniterproject/index.php/student
现在当我提交这个表单时,URL变成了:
http://localhost://mycodeigniterproject/index.php/mycodeigniter/controllers/index.php/student/insert

而我期望它应该是:

 http://localhost/mycodeigniterproject/index.php/student/insert

我的代码有什么问题?为什么CodeIgniter不使用相对路径?

echo form_open('/student/insert',array('name=>'myform');

echo form_open('student/insert',array('name'=>'myform');

这应该能奏效。

编辑:

看这里。您将看到一个表单帮助器如何工作的示例。