Browsing the archives for the Web development category

Prevent Image Caching

Browser image caching was causing me a problem today.
When a user of a client site uploads a profile image, it intentionally overwrites the old image. However, when viewing the profile page, the old image is shown unless you refresh the page.
Preventing browser image caching
The solution was quite simple. In order to force the browser to [...]

No Comments Posted in Web development, php
Tagged , , , ,
PHP Multidimensional Arrays

Multidimensional arrays are arrays which contain arrays and each of those may also contain arrays. There is no limit to the number or level of sub-arrays.

No Comments Posted in php
Tagged , ,
Joining Tables: MySQL Join

MySQL Join Tables

The MySQL JOIN command allows you to acquire/manipulate data from more than one table in a single query statement.

MySQL JOIN commands can be used in SELECT, UPDATE and DELETE statements.

However, MySQL JOIN commands use a lot of database resources as they need conditional matches across all of the tables.

The Simple MySQL Join
This is [...]

1 Comment Posted in mysql
Tagged , , ,
htaccess AddType for Custom web page suffix

A week or so ago, another developer showed me the Nectar Points website (www.nectar.com) and pointed out that the webpages appear to have a custom suffix – in this case .nectar
So, how did they do it?
It appears that the website is on an Apache server, my guess is that they used the .htaccess ‘AddType’ directive.
The [...]

3 Comments Posted in Web development
Tagged , , ,
What is MySQL Injection?

MySQL injection occurs when someone unauthorised attempts to run an MySQL statement on your database. This will normally take the form of inserting a MySQL statement where you would normally expect some user input – maybe their username.
MySQL Injection Prevention
There is a PHP function which can be used to prevent MySQL injection attacks:
mysql_real_escape_string($variable)
The mysql_real_escape_string() makes [...]

3 Comments Posted in mysql
Tagged , , , , ,
What are PHP recursive functions

Recursive functions are functions which call themselves. They are particularly useful when working with multi-dimensional arrays. However, using recursive functions should be avoided if the function is likely to be called over 200 times, as it may kill the script.

Here is a very basic example of how one could use a recursive function in PHP:

<?php

# [...]

No Comments Posted in Web development, php
Tagged , , ,
What is 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, [...]

1 Comment 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 [...]

No Comments Posted in Codeigniter
Tagged , , , ,
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 [...]

1 Comment 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 [...]

1 Comment Posted in General, Web development
Tagged , , ,