Blog Form - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Blog Form (/showthread.php?tid=65117) |
Blog Form - davy_yg - 05-01-2016 BLOG FORM Date : May 2016 Su Mo Tu We Th Fr Sa Upload : [Upload] Title : New Title Content : New Content I try to input New Title and New Content. But my form does not work. It cannot input my intended content which is "New Title" and "New Content". How to code it right so that I can input the form? views/blog_form.php PHP Code: <h1>BLOG FORM</h1> models/blog_model.php PHP Code: public function insert_blog() RE: Blog Form - gregormck - 05-02-2016 I'm not 100% sure what you are asking, but you need input fields for 'title' and 'content' as a good starting point ie: <input type='text' name='title' /> <input type='text' name='content' /> RE: Blog Form - davy_yg - 05-03-2016 Well, please check my code above: views/blog_form.php This is the actual view: BLOG FORM Date : May 2016 Su Mo Tu We Th Fr Sa Upload : [Upload] Title : [ ] Content : [ ] [Submit] -------------------------------------------------------- If someone click the submit button it will actually show this: http://localhost/blog/index.php/blog_form 404 Page Not Found The page you requested was not found. If I click the submit button it will carries me to success form and store data in the database. I would like to know if someone input in title form or content it will actually place input in the database. I also have revised my codes: views/blog_form.php PHP Code: <html> controllers/blog.php PHP Code: <?php models/blog_model.php PHP Code: <?php RE: Blog Form - cartalot - 05-03-2016 Hi - hey you are making some very basic mistakes. So first - do the tutorial in the manual. http://www.codeigniter.com/user_guide/tutorial/index.html |