2012-07-30 85 views
0

我嘗試這種鏈路上的教程創建窗體:無法顯示形式 - 笨

http://codeigniter.com/user_guide/libraries/form_validation.html

但是當我在URL類型(創建的form.phpformsuccess.php文件後myform.phplocalhost/codeigniter/index.php/form,我得到404 Page Not Found的錯誤。

我是Codeigniter的新手。有人能幫我弄清楚錯誤嗎?感謝致敬。

+0

ü可以添加應用程序目錄結構? – user1190992 2012-07-30 19:23:11

+0

你的意思是說我的文件的路徑? – kamalbhai 2012-07-30 19:24:26

+0

是的。你應該有文件codeigniter/application/controllers/form.php codeigniter/application/views/formsuccess.php codeigniter/application/views/myform.php – user1190992 2012-07-30 19:26:31

回答

1

Codeigniter是一個MVC框架,因此URL層次結構處理有點不同。

你能訪問localhost/codeigniter/index.php嗎?

否:你有正確的.htaccess文件嗎?

是:在你的控制器文件夾,你有一個名爲form.php的用下面的代碼文件:

class Form extends CI_Controller { 
    function index() { 

    } 
} 
+0

是啊..在我的控制器文件夾中..我有名爲'form.php'的文件,其中包含您提到的內容.. – kamalbhai 2012-07-30 19:30:24

+0

您能訪問localhost/codeigniter/index.php嗎? – 2012-07-30 19:31:16

+0

是的..我可以訪問此文件.. – kamalbhai 2012-07-31 03:59:57