0

私はこのようなフォームを持っています:

<?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 が相対パスを使用しないのはなぜですか?

4

1 に答える 1

1

からフォームを変更します。

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

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

これでうまくいくはずです。

編集:

こちらをご覧ください。フォーム ヘルパーがどのように機能するかの例が見つかります。

于 2013-06-02T09:33:14.797 に答える