What is Codeigniter

CodeIgniter

CodeIgniter

CodeIgniter – created by EllisLabs and first released in 2006, CodeIgniter is a freely available MVC web application framework used for developing websites using PHP.

CodeIgniter ships with a large library commonly used OOP classes, enabling the developer to call them rather that using time creating her own. When compared to other similar MVC frameworks, CodeIgniter is said to be:

“..faster, lighter and the least like a framework.”  Rasmus Lerdorf 2008

Benefits of CodeIgniter

  • Get started quickly
  • No need to install other packages
  • No need for mass configuration
  • Compatible with PHP 4 & 5
  • Detailed user guide
  • Enables faster cleaner development
  • Easy to extend by adding your own classes
  • It’s OpenSource
  • MVC architecture allows for code separation

More information about CodeIgniter is available from CodeIgniter.com

No Comments Posted in Codeigniter
Tagged , , ,
CodeIgniter base_url: Make it dynamic

CodeIgniter Base URL

When you install the CodeIgniter framework on your server, the base URL and certain other settings are automatically configured on install. These settings are relevant to the server you are installing on. The base url is set to the domain you are installing CodeIgniter on (eg. www.uk-webdeveloper.co.uk) and is called by a method in my class Start extends Controller in this manner:

function Start()
{
parent::Controller();
$this->load->helper('url');
$this->load->library('menu');
$this->load->library('menulower');
$this->load->library('banner');
$this->base = $this->config->item('base_url');
$this->css = $this->config->item('css');
}


As you can see from the method/function shown here, the base_url is located in the config file of your CodeIgniter installation.

Now, as mentioned above, CodeIgniter sets the base_url on  install to that of the domain it is installed to. So what happens when you move the whole application to another domain? It may stop functioning.

The Base URL solution

The solution is quite simple.

1. Locate and open your config file (usually at system/application/config/config.php)

2. Find this line:
$config['base_url']    = ‘http://www.yourdomain.co.uk’

3. Replace that line with
$config['base_url']    = ‘http://’.$_SERVER['HTTP_HOST']

4. Save the file.

Now wherever you move the application to, it should still work as expected.

codeigniter base url

No Comments Posted in Codeigniter
Tagged , , , ,
Start with HTML5

HTML5

Getting started with HTML5 is very easy.

HTML 5 is compatible with the XHTML syntax of self-closing tags, so, if you already use HTML5 then making the switch will be easy. Other XHTML features inherited by HTML5 include lowercase tags and double quoted attributes (eg, title=”the title”)

The Doctype declaration in HTML5 is so much easier to remember when compared to XHTML:

<!DOCTYPE html>

There’s a lot more to HTML5 and I will update this entry as I get more info.

 

No Comments Posted in General
Web Developement – unseen benefits of compliance

Wanna know why my personal web developer site is so high when searching for ‘cheshire web developer’ in Google, Bing, Yahoo, plus many more?

No.1 on yahoo.com when searching for the generic term ‘web developer’ and selecting results ‘from the web’.

Probably not, but here goes:

When I decided to rebuild my site, I considered SEO right from the planning stages

No Comments Posted in SEO - Search Engine Optimisation, Web development
Tagged , , , , , , ,
Large enquiry forms versus small enquiry forms

Instead of, or maybe as well as, an email link, most websites now contain some sort of contact or enquiry form. However, there is always a question of whether this form should be short and concise or long and detailed.

The short form will contain few fields, requesting basic information. The most common I have seen asks the user for her name, contact email address and telephone number, and then has a <textarea> where the user puts their questions or comments. It can take any thing from a few seconds, to a couple of minutes to complete. Quick and to the point. Useful if one needs to make a generic enquiry, such as ‘What time are you open on Friday?’

Example Short Form

Example short form

A large form asks for a lot more details – well over ten fields – and will normally take many minutes to complete in its entirety. As well as asking for more information about the user, it will often require detailed information about the product or service you are enquiring about. For example, asking for size, colour, style, amount, weight, etc. (example here)

Most of us would assume that the shorter enquiry form is going to get the responses we want, which can then be converted into sales. Afterall, it is shorter and takes less of the users time to complete. The table below shows the results of research carried out by PRWD.

Form type Preference Conversion rate
Short 14% 17%
Detailed 86% 55%

It appears that, not only do the vast majority of those who complete enquiry forms prefer the detailed comprehensive form, but the conversion to sales rate of the detailed form is over three times that of the short form. This flys in the face on conventional thinking and if anyone knows the reasons for this, I would love to hear them.

These figures are justification for those of us developing e-commerce or lead generating websites, to give serious consideration to including a detailed enquiry form.

More information available from http://www.prwd.co.uk/

No Comments Posted in General, Web development
Tagged , , ,
XSL problem with Mozilla Firefox

If you are having problems with your XSL styles not being applied in Mozilla Firefox and Safari, try changing this line above the <head> of the XSL file:

<html>

to look like this:

<html xmlns=”http://www.w3.org/1999/xhtml”>

No Comments Posted in Web development, XML
Tagged , , , , , ,
Usability, accessibility and screenreaders

This video from the University of Arkansas shows why descriptive text rather than ‘click here’ should be used for links and how skip navigation can improve user experience.

[youtube=http://www.youtube.com/watch?v=bQpNYDvQ010&hl=en&fs=1]

No Comments Posted in General, University, Web development
Tagged , , ,
Change date from American format in ASP

This short ASP script will change the date in your database table from American format to a format which can be understood universaly.

OrderDate in the script refers to the column in the database table where the date is stored.

<%
'Change from American date format
If Day(DBOutput("OrderDate")) < 10 Then
'add a leading zero if date is single digit
Response.Write("0" & Day(DBOutput("OrderDate"))) & "

No Comments Posted in ASP, Web development
Tagged ,
Database connection script

As a developer, you probably use different servers throughout the development process. When you move your application from one server to another, you maybe have to change the database connection script in order for the application to work on the new server.

If you forget to do this, and the client is sitting in front waiting to see their new web application, it can be quite embarrassing. So, use this script to include several servers in your database connection statements and all will be fine.

<?php

/*This file is intended to be able to connect to your MySQL
database no matter where it is situated.
Insert your connection details for your different hosts into the
switch statement below.
You can add more hosts if you need to. */

$host = $_SERVER['HTTP_HOST'];

switch ($host)
{
case 'localhost':
$server = '';
$user = '';
$db = '';
$password = '';
break;

case 'domain of host 1':
$server = '';
$user = '';
$db = '';
$password = '';
break;

case 'domain of host2':
$server = '';
$user = '';
$db = '';
$password = '';
break;

default:
$server = '';
$user = '';
$db = '';
$password = '';
}

$link = mysql_connect($server, $user, $password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}

$selected = mysql_select_db($db,$link)
or die("Could not select database");

?>
No Comments Posted in Web development
Tagged , , , , , , , ,
Promoting a website

So you have your new website, which has cost you a lot of money, and it has recently gone live. Yet the hundreds of enquiries you expected to pour in from the website have not materialised and the 100 visits your site is getting each day are all from your office. What has gone wrong?
The short answer is nothing has gone wrong.

Many people, when they get a company website, have unrealistic expectations and think that having a website will suddenly bring in thousands of new customers from all around the globe. The first challenge is making it easy for people to find your website. Of course we all know about registering with search engines but, when there are approx 600 million websites on the Internet and they cannot all be top of Google, one should not rely totally on search engines for delivering visitors to your website.

There are other ways, apart from search engine submission, to get visitors to your website.

Online

Web referrals are an effective way of driving visitors to your website. There are a number of ways you can generate these.

  • Include your web address in all email footers.
  • Email newsletters – sending email newsletters of offers and new products can be quite effective. People send them on to others.
  • Banner ads, Pay per click – rarely free, but can help bring people to your website.
  • Reciprocal links – if you know a site with similar content to yours, ask them link to yours, but be prepared to reciprocate.
  • Blogs, Forums, social network sites etc – whenever you use one, end your entry with a link to your website.
  • Directory sites – register with as many as you can and when entering details of your business, remember to include your website address.

Offline

The website complements rather than replaces existing marketing activities and, therefore, should form an intergral part of your entire marketing strategy.

Ensure your web address is included on:

  • packaging,
  • promotional items,
  • all business stationery,
  • invoices,
  • business cards,
  • all publications about the business,
  • Word of Mouth – talk about your website at every opportunity to customers, family & friends

I analysed the stats for my website (www.jez-d.co.uk) and only 1.5% of visits are referred from search engines. The vast majority are direct requests, that is, not from a link on the Internet. This shows that other methods as mentioned about actually do work.

1 Comment Posted in General
Tagged , , , ,