What is CodeIgniter, and how does it work?

What is CodeIgniter?

ci logo2

CodeIgniter is a free, open-source, easy-to-use, object-oriented PHP web application framework, providing a ready-to-use library to use with your own PHP applications. For example, there is a Database API to make it easier and more convenient to execute SQL queries, such as SELECT, UPDATE, DELETE, INSERT, etc., without having to create a lot of repetitive code yourself. This is how an application framework is useful in application development.

CodeIgniter is object-oriented

Using CodeIgniter requiring knowledge of using the object-oriented programming technique in order to be able to use CodeIgniter effectively, and to understand what happens when you are using certain features in CodeIgniter.

But, what is object-oriented programming?

It’s quite difficult to explain object-oriented programming because from a conceptual point of view, it is difficult to understand. However, the main purpose of object-oriented programming is to make application development easier, especially as applications become bigger, with large structures. Object-oriented programming allows application code and logic to be easier to understand, structured and coherently in place, making it easier to develop and extend your application’s features and functionality. With procedural programming (which is merely standard code executed line-by-line with the use of functions as a container for code that help prevent repetitiveness and “reinventing the wheel”), applications can become a mess if they aren’t developed in a way where everything is well laid out, coherent and structured, and can be more difficult to extend and add new features and functionality to your applications later on. With object-oriented programming, in a way, you are forced to be coherent and have your code structured correctly.

Classes and Methods

What are classes and methods? These are the first concepts you’ll be introduced to if you are learning object-oriented programming from most books or online resources. Say you’re creating a framework. You’ll have different classes for different parts of your framework. One being a “Database Class”, one being an “E-mail Class”, and so forth. Of course, in this case, the Database Class is like the CodeIgniter Database Class, providing a set of ready-made methods for you to use so you don’t have to create them yourself in order to execute certain application logic, such as inserting, updating and removing database records quickly, without having to “reinvent the wheel”.

The methods are what contain the application logic, and the class merely holds many related methods together. And this is exactly how your applications would work with the use of the object-oriented programming techniques.

How does CodeIgniter work?

CodeIgniter has a very extensive user guide, which is much better than documentation on some other frameworks, such as CakePHP (which is another PHP framework).

CodeIgniter has classes and helpers.

Classes

Classes contain a collection of methods and properties (properties are essentially variables in an object-oriented context).

For example, here is an example using the Database library within CodeIgniter:

$this->db->get(‘users’,$data);

In any application you make using CodeIgniter, your own classes inherit (or extends) the CodeIgniter class, and so this is why the $this variable is used, which refers to the current class/object. So to call another method within your class, you would use $this->method_name().

Helpers

Helpers contain ordinary PHP functions. Such as the Form Helper.

Other interesting features of CodeIgniter

While this is by no means unique to CodeIgniter, and other web application frameworks use this approach to application development, CodeIgniter primarily uses the Model, View, Controller (MVC) approach to application design and development. It essentially separates application logic from the application design/view. The application logic is the Controller, whereas the application design/view is the View. The Model is for database interactions. There are more complex scenarios where the MVC approach is used, but for basic to intermediate CodeIgniter applications, the Model would contain database interactivity logic of sorts.

Active Record

When you saw an example of using the Database Class above, that code is actually part of the Active Record Class that is part of the Database library.

Active Record is where your work can be shortened by providing an easy and convenient way to execute certain SQL queries without having to write out the entire SQL query yourself. Active Record essentially allows information to be updated, retrieved, added and removed conveniently.

More information on CodeIgniter

The CodeIgniter framework works on all of our shared and reseller servers, and can be installed on pretty much any server with PHP installed. As of writing, CodeIgniter requires PHP version 5.1.6 or higher and obviously a database will be required for any database-driven PHP application (as of writing, MySQL 4.1 or higher). CodeIgniter also supports PostgreSQL, Oracle, SQLite and ODBC. For up to date server requirements, see the CodeIgniter user guide.

Visit the CodeIgniter website

Related Posts:

  • No Related Posts

A List of Top WordPress Security Plugins

The ratio of websites running on CMS’s can be assumed to be more than the custom designed sites built from scratch. Quite understandably, there are more number of users using WordPress than any other CMS, hence it becomes crucial to have enhanced security measures for your site. Due to a large volume of users using WordPress as a platform, an increasing number of hackers and fraudsters try to compromise the security of such sites. In majority of the instances sites running on WordPress are compromised due to outdated files and/or plug-ins. Such outdated versions of the associated scripts act as an easy meal for fraudsters.

So what measures should an individual adopt to keep a WordPress installation safe and secure from being compromised ?
Primarily, it is crucial to have a latest version of WordPress. In-addition, there are couple of useful WordPress plug-ins that can help you safeguard your website hosted on an affordable web hosting server.

Top List of WordPress Plugins For Enhanced Security

BulletProof Security
Average Rating : 4.5 || Total Downloads : 143,241

This plugin in particular has been considered to be one of the reliable security plug-ins for WordPress. It helps in protecting a WordPress based site against XSS, RFI, CRLF, CSRF, Base64, Code Injection and SQL Injection hacking attempts. Moreover, it offers a single click .htaccess WordPress security protection.
The files that are protected with this plugin are wp-config.php, bb-config.php, php.ini, php5.ini, install.php and readme.html with .htaccess security protection. Moreover, it holds the capability to check DB errors off, file and folder permissions check.

6Scan Security
Average Rating : 4 || Total Downloads : 3,844

The plugin is claimed to offer protection against the SQL Injection, Cross-Site Scripting (XSS), Directory traversals, Remote file inclusion, including the one’s listed in OWASP Top Ten security vulnerabilities.
It has been developed in a way that there is no adverse effect on the site’s performance.

Ultimate Security Checker
Average Rating : 4 || Total Downloads : 35,851

This too similar to couple of other plugins seems to be quite appreciated by users. It a common scenario where a hacker manages to get access to the WordPress installations and delete the data it contains. The Ultimate Security Checker is capable of identifying security issues on your site. It scans the installation for known vulnerabilities and grades it accordingly. It suggests the vulnerabilities which you may either fix on your own or do it automatically.

wordpress new 1

Better WP Security
Average Rating : 4 || Total Downloads : 41,417

The plugin ensures that multiple security holes are patched without the need to bother about conflicting features. It comes with a built-in feature that bans troublesome bots, switches off the ability to login for a given time period, bans the users trying to login too many times with incorrect information and more importantly it enforces strong passwords for all accounts.

WP Plugin Security Check
Average Rating : 5 || Total Downloads : 4,168

It may at-times happen that due to an outdated security plugin a hacker manages to breach in, this plugin searches for plugins for bad practices and possible security holes limiting the risk of a compromised website.

Secure WordPress
Average Rating : 4 || Total Downloads : 611,889

This plugin removes the error information on login pages, adds index.html to plugin directories, hides the WordPress version (except from the admin area) hides the plugin-update information for non-admins, it blocks any bad queries that pose harm to your WordPress installation.

WP DB Backup
Average Rating : 4 || Total Downloads : 1,238,595

We all are aware about the importance of website backup, this plugin allow users backup the core WordPress database tables with minimum clicks. Looking at the number of downloads one can imagine its popularity amongst webmasters.

WP-DB Manager
Average Rating : 4 || Total Downloads : 601,825

This plugin would enable users to manage the database effectively. Optimization, repair, backup, restore database, delete backup database ,etc. can be carried out with enough simplicity. Moreover, webmasters may even automate the processes of back-up, optimization and repairing of database.

WP Security Scan
Average Rating : 3 || Total Downloads : 897,847

This plugin in particular scans your WordPress powered website for vulnerabilities and offers corrective measures for various parts such as Passwords, File permissions, Database security, Version hiding, WordPress admin protection/security and Removes WP Generator META tag from core code

Login Lockdown
Average Rating : 4.5 || Total Downloads : 135,907

This plugin restricts a user from too many failed login attempts, it makes a note of IP address and time-stamp of every failed login attempt. If a user tries to access the website thrice using incorrect login details within 5 minutes, the login function gets disabled for all the IP’s within that range. This helps in preventing the hackers from trying different combinations of login credentials to gain access to your website.

User Locker
Average Rating : 5 || Total Downloads : 33,695

This is one of the alternatives to the plugin ‘Login Lockdown’ which helps in preventing any unauthorized access to your website. Its works on the same logic helps restrict fraudsters from gaining unauthorized entry to your website.

Limit Login Attempts
Average Rating : 5 || Total Downloads : 107,935

It is a fully customizable plugin that restricts users from attempting multiple failed logins into the WordPress admin console. This is again an alternative to the above two plugins.

Login Encrypt
Average Rating : 4 || Total Downloads : 3,221

Login Encrypt is a security plugin that uses a a complex combination of DES and RSA for encrypting and securing the login process to the admin panel. It was developed with an intention of using for securing the login to the web hosting control panel and was later released for WordPress.

One Time Password
Average Rating : 4.5 || Total Downloads : 7,531

This is one of a kind WordPress plugin that generates a unique one-time password for each login. This helps you keep the unauthorized users away from accessing the admin areas of your site. The OTP (One Time Password) expires upon usage, sent via, email to the registered email address every time you want to access the WP-admin area.

Fast Secure Contact Form
Average Rating : 4.5 || Total Downloads : 2,125,581

The Fast Secure Contact Form plugin enables webmasters with creating and adding contact forms to their WordPress installations. Requester can send emails to a site’s admin, moreover they even get a scope to fix meeting requests via. a simple form. The administration of the site can create and preview multiple number of forms. The site admins can also set availability and synchronize the contact form with Google calendar enabling them to effectively manage the appointments. It supports Akismet anti spam protection hence making it a spam free plugin. The messages received by the administrator contains blog username, Date/Time timestamp, IP address of the sender, making it simpler to categorize and know more about the sender.

I hope you found this article useful. We’ll keep updating our blog with the latest and useful plugins which may help you have a great experience with using your WordPress installation.

Related Posts:

Most Common Service Names and Their Port Numbers

Generally, the services and its port numbers are used to differentiate between various services that execute over transport protocols such as TCP/IP, UDP, DCCP, and SCTP. The service names were assigned on a first-come, first served process and in different ways, based on three ranges:

  • System Ports (0-1023)
  • User Ports (1024-49151)
  • Dynamic / Private Ports (49152-65535)

However, with the growth of Windows and single-user Linux systems, the port model that were trusted no longer works.

The most common Service names and their Ports are mentioned below:

Service Name Port Number
FTP 20, 21
SSH 22
Telnet 23
SMTP 25
DNS 53
DHCP 67, 68
TFTP 69
HTTP 80
POP3 110
NNTP 119
NTP 123
IMAP4 143
LDAP 389
HTTPS 443
IMAPS 993
RADIUS 1812
AIM 5190

On Linux machines, the following file consists all the list of port assignments for the specific machine:

/etc/services

Whereas, on Windows machines, the following file describes the service names using port numbers with protocols:

C:windows\system32\drivers\etc\services

Related Posts:

  • No Related Posts

Backup your Website before a Disaster Strikes

Assuming that you have a website which has been developed either recently or has been living over the web since quite sometime. It may be a personal site running a blog, portal, designs etc. or may it be a business site where your sell products or services. All seems to be going well and the site is being appreciated and shared by users across the web. There must have been serious efforts which you Disaster Recovery1might have taken to get the site to a certain level. Not to mention the time and money you’ve invested in it. During this while you’ve been focused on making the site successful over the Internet, but have you ever realised what would happen if the site suddenly goes inaccessible without a prior warning, it may be due to any odd reasons this may happen. What if your server holding the web-pages of your site crashes and after investigation the support staff from the web hosting company get back to your saying the hard-drive has got corrupted and all the data that was held has gone. Disaster Strikes !What if I say that there is nothing to worry about. If you’ve chosen a host that offers managed hosting services, there is a wide possibility that a backup copy of the files in your account would be available with them. This backup can be restored and your site could be brought back online within minutes.

Consider a possibility where the hosting company does not backup their servers too often, it means nothing but your efforts, your time, your money, your business have all been wasted, and you need to start back from the grass-root level. I don’t need to say about the frustration and agony that you’d face. Moreover, the time and money that you’d need to reinvest in getting the site back live.

Now I suppose you might have realised the importance of having a backup of all the data required to keep your site running over the web. Accidents and disaster don’t offer a warning before striking, all you can do is to have a backup plan to recover from it in the least possible time without spending too much, I mean that’s business. Backing up your site regularly becomes extremely important in this fast paced world of Internet.

There may be various reasons to justify the need to have a latest backup of your website at any given point of time. Choosing an offsite backup plan from an affordable web hosting provider can keep you away from devastation to your website and your business. Following are a couple of reasons why you must opt for such a solution, it was something where I didn’t need much efforts, they just came spontaneously. There are multiple instances that have happened in the past which have caused serious losses to businesses.

It may be a human error where the delete button gets hit accidentally, usually seen in cases where more than one individual have an access to the account. So imagine the possibility of the human error that may occur, your files, contact details of your customers, emails, etc. etc. can all disappear in a flash. Recollecting it can be a nightmare, expensive and more importantly it may pose a threat to your reputation.

If you have a busy website and the content gets updated frequently, it becomes necessary to maintain a backup of the data, because if a disaster does strike all the data that the site is updated with would be lost. Whereas if you do have a backup in place, the loss can be kept to minimal. For example, if you run a social bookmarking site or even a forum board, loss of all the data posted by the users wouldn’t be too pleasing to you nor for the users.

A gist of everything is that, such situations can be avoided if you have your site backed up with possibly the latest content. This should not only save you money but your efforts, time, reputation can all stay intact, even the users can understand the unforeseen situations. Moreover, the backup plans comes at a much cheaper price as compared to the heavy losses which you may face if it isn’t there in place.

backup

Related Posts:

DNS Propagation and Caching – Factors Affecting the Process

728x90 1

Whenever a domain is switched between registrars or change an IP address, you are more likely to face delays caused by the DNS propagation. This can hardly be avoided, but its impact can be reduced to some extent.

The domain name server propagation is basically the time taken to update the DNS records across the DNS infrastructure around the globe. The DNS system basically helps in keeping the load on your nameservers low due to the caching feature it holds. It is due to the caching mechanism that gives rise to the DNS propagation, if it wouldn’t have been there, all the requests made to your domain would have flooded your nameservers for every lookup, which would have inturn put more pressure causing to malfunctioning or even non-functionality of these servers.

There are resolvers, a kind of servers that takes care of running the DNS queries for the web users, cache a copy of the zone files of any domain at the very beginning when a request is made for an information about a domain. Until the next cache update, all the DNS queries are served from the most recent zonefile that cached in the system. Such a mechanism helps in reducing the overall process load and bandwidth of a DNS nameserver.

The main reason for the propagation is basically the DNS caching. Consider a situation where a resolver has cached a zonefile for approximately 5 hours and the IP address has been switched to a different one and the records have been updated in the nameserver after sometime within this while, then the resolver would still exhibit the incorrect DNS information for approximately 5 minus the time at which the IP was changed. Only after all the resolvers from all across the globe are updated with the latest zone file, we say that the propagation has been completed.

At-times the DNS Cache gets poisoned or polluted, check more on this here – DNS Cache Poisoning

This was about the general procedure, but being an owner of a domain, you can set time within the zonefile called as the Time To Live (TTL). In there you must assign time in seconds which tells the DNS resolver about the applicable cache for a zonefile before it comes back asking for a new one. As a default value 14400 seconds ie. 4 hours are set. Though domain owners may make changes to these DNS settings, you must keep in mind that the changes would take effect in approximately 24 hours. Ofcourse, you must also check with your ISP whether they allow the TTL settings to be changed.

Not many are aware about the multiple uncontrollable factors that affect the DNS propagation time for a particular domain name. It may take anywhere between a couple of hours to approximately 48 hours for the propagation to complete.

What are the factors that affect the DNS propagation time?

TTL (Time to Live) Settings — As discussed above the TTL is set for every domain name server record which is help within the zone file. It is the period of time for which the servers cache the information for DNS records. Lesser the time set, causes to an increase in the number of queries to your nameserver, causing an increase in load resulting in a degraded server performance.

ISP (Internet Service Provider) — The ISP would usually cache the DNS records at their end inorder to avoid retrieving retrieving information from your domain name server everytime. This also helps them serve the requests faster hence increasing the surfing experience for users. Few ISP’s maybe an exception to this by overlooking the TTL settings and only update their cached records after fixed intervals of time.

Domain Name Registry — If the DNS’s are changed, the changes are forwarded to the registry after-which the new record updates is processed to the root zone. Different registries might take different times to update the records as their TTL setting are set high for the name server records. Moreover, even though recursive nameservers doesn’t cache the root NS records usually, though few ISPs cache the information anyway, further resulting in a delay in the propagation time.

728x90 1

Related Posts:

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »