Thursday, 21 May 2015

Codeigniter Basic and Imp Thinks

Codeigniter Basic


1. Perfect MVC Architecture
The model, view, controller architecture is nothing new. It seems like all the coding frameworks are MVC now a days, and if they aren’t it can be configured easily. The MVC way of doing things offers nice code separation and keeps things clean. Some frameworks force you to do things by the books but CI lets you use MVC in a way that makes sense you. 

2. Little to no server requirements.
Unlike other PHP frameworks, CI works with both PHP 4 and 5. That makes the lives of someone like me who has to be able to work seamlessly between the two environments much easier.

3. Easy to understand and extend.
CI is the first framework that I used that actually makes sense to me. I was able to get up and running with CI the quickest. CI is also easy to write new libraries, change the behavior of existing libraries and just change the overall behavior of the framework with little effort.

4. All the tools in one little package.
Calendar, e-mail, zip encoding, validation, uploading, sessions, unit testing… that is just a few of the built in libraries that come with CI. It also includes a boat load of default helpers for things like forms, file handling, arrays, strings, cookies, directories and more. Plus, if that wasn’t enough, you can create your own libraries and helpers or use code that has been developed by the CI community.

5. No “installation” necessary.
CI fits this requirement nicely. No need for PEAR packages or server modifications to get the framework up and running. Just upload the files to your server and your off.

6. Built in security tools.
CI allows you to implement as much or as little security as you feel is necessary for your app. It does some things by default like unsetting all global variables regardless of PHPs register_globals directive and turning off the magic_quotes_runtime directive during system initialization so that you don’t have to remove slashes when retrieving data from your database. Other things can be enabled like cookie encryption, handling session data with a database and automatically escaping SQL queries.

7. Database abstraction.
Every decent framework has a database abstraction layer now a days and CI is no exception. You can easily create insert, update and delete statements without needing to write raw SQL. Handle connections to multiple databases within one application

8. Active user community.
There is a nice and big user community to work with when you have a problem or question. The CI website has a forum and wiki when you’re looking for answers. No confusing group mailing lists or chat channels just to get a quick answer to a question.

Sunday, 17 May 2015

Working of Ajax


AJAX

AJAX = Asynchronous JavaScript and XML.
AJAX is a technique for creating fast and dynamic web pages.
AJAX can be used for interactive communication with a database.
AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.
Classic web pages, (which do not use AJAX) must reload the entire page if the content should change.


How AJAX Works
ajax working


Validation

Validation :-
Validation is a process of testing and ensuring that the user has entered required and properly formatted information through the web form.

Client-side validation :-
In client-side validation method, all the input validations and error recovery process is carried out on the client side i.e on the user’s browser. It can be done using JavaScript, AJAX, HTML5 etc.

Server-side validation :-
In server-side validation, all the input validations and error recovery process is carried out on the server side. It can be done using programming languages like PHP, VB.NET etc.

Differences and comparison:
Client-side validation is faster than server-side because, the validation takes place on client side (on browser) and the networking time from client to server is saved.
On the other hand, server-side validation is done on the web server. Then the server renders the data into html page and sends back to the client (browser).

Server-side validation is more secure than the client-side as the user cannot see the code even he does a view-source.