Showing posts with label Codeigniter. Show all posts
Showing posts with label Codeigniter. Show all posts

Sunday, November 23, 2014

After creating this interface  when i clicked the "Create Your Account" button i want to insert that entered data into database.

According to MVC architecture let's see how to connect view,controller and model.

After creating view we have to call controller.We can use form_open() method to call controller.

According to this interface ,

View :


In line no 14 and 16 it call to the controller.form_open() method you can give your controller name and function that want to execute.As well as make sure to use form_close() method at the end(line no 101).

Now let's see how to implement controller.

Controller:





























Index() :The "index" function is always loaded by default
In here it help to load the register interface.Then after clicking the "Create Your Account Button" it will direct to the createAccount().

First we have to call the model(line no 12).Then we have to create variables to catch the values (line no 13-18).

ex: line 15
$firstname : variable name
$this->input->post('FirstName') :Using post we can catch the value that user entered.We just need to pass the text field name that we named in the view(line no 47).

After we have assigned values to the variable we can use array to pass that data into database.We just need to pass the column name of the database table  and variable that we have created(line no 20-27).Next we have to call the model function to insert data(line no 29).

Next we move on to model,

Model:











In codeigniter it's really easy to insert data we can directly use insert() to pass the data to the database.We just need to pass table name of the database table and array name.

Friday, September 12, 2014

Codeigniter


Codeigniter is a powerful PHP Framework with a very small footprint,built for PHP coders who need a simple and elegant toolkit to create full featured web applications.



MySQL


MySQL is the world's second most widely used open-source relational database management system (RDBMS).MySQL is a popular choice of database for use in web application.


Bootstrap

Bootstrap is the most popular HTML,CSS and JS framework for developing responsive, mobile first project on the web.


JQuery


jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.