Archive for January, 2010

Many websites created today are created from automated php scripts such as blogs or content management systems. These types of sites rely heavily on php include statements to build the website.

If however you build your own static page websites, where each page is individually created by hand, you could still benefit from the use of php include statements. By using these include statements you can greatly decrease the amount of time it takes to edit or create new pages for your site.

Most websites can be sub divided into 4 or 5 sections:

Left Menu Column
Content Area
Right Menu Column
Footer

Basic Website Layout

Basic Website Layout

In a static multi page website if you want to change the header, footer, left or right menu then you need to make the same alteration on each individual page. For example, if you add a new page then you would have to add this page to the menu on every other in your site. This isn’t to much of a problem on small sites with only a few pages, but can be time consuming once you get 10 pages or more.

If you use php include statements then you can create separate php files for each component of your site and include them into your website template. Then if you want to make a change all you need to do is edit one file, and it will appear on all of your pages.

Lets take a look at a quick example. We will create a basic template to see how it works. Open your favourite text editor such as notepad and create a file called index.php and copy the following into it.

Now create a file called header.php and copy the following into it

Now create left-menu.php for your left menu with the following code

Now create right-menu.php for your right menu with the following code

Now we just need a footer.php

Copy the five files to a folder on your server and then navigate to the index.php to see the result. To see how easy it is to edit, duplicate the index.php a few times, changing the text in the content area and save save them as page1.php, page2.php, page3.php and so on. Upload them to the same folder on your web server as the other pages. Open the left-menu.php and change the links for the menu items to suit, and overwrite the file on the server with this edited file.

Now if you visit your new site you will see that the links are functional on all pages. If you add another page then you only need to edit left-menu.php, to have it appear on all of your websites pages.

For this to work you will need to save your pages with the .php extension, if you use .htm then your includes will not appear. If you want more information on basic php visit the downloads area of this site and download ‘I Hate PHP’.

Free Graphics Software

Creating graphics for your website is something every website owner has had to struggle with at some point in time. If you are working on a budget then top end graphics programs such as Photshop are probably not an option. You can however get free graphics software programs quit easily that are probably better suited to your needs.

One source for free graphics software is a company called ‘Serif’. I’ve been using their packages for over 10 years now. They continually update and upgrade their software, and offer older packages for sale at £9.99 or a free SE version for free.

The 2 serif packages I use are Photoplus and Drawplus. Photoplus is great for editing any photos that you may want to use, while draw plus is suited to making banners, animations and illustrations.

For more details visit:

http://www.freeserifsoftware.com/

Another free graphics software package worth looking at is Gimp. This is free open source software along the lines of Photoshop. There are versions available for Windows, Linux and Mac. With this software you can edit photos and create website banners.

http://www.gimp.org/downloads/

Gimp has been around for years and has plenty of tutorials online to help you get the most from it.

These free graphics software programs should cover all your graphic editing needs at a price everyone loves. Even Serifs latest products are reasonably priced if you want all the bells and whistles.


image: Serif - Software with Imagination

If you are looking for a reliable UK web host, then you need look no further than TSO Host. I’ve personally been using this hosting company for almost a year now and found them to be reliable approachable. If you have any problems, of which I’m happy to say I’ve had very few, then their friendly support staff will sort out the problem quickly and professionally. I’ve had support tickets answered in under 10 minutes.

They offer 2 styles of web hosting, the normal Windows and Linux shared hosting packages with varying amounts of web space and bandwidth, and their Clustered Platform where you can host 100 web sites with 100GB storage and 1000GB of monthly data transfer.

It was the Clustered Platform that first drew me to TSO Host, as I was looking for a UK web hosting account that allowed me to easily set up multiple websites. Most web hosting companies that allow multiple websites use cpanel as the control panel, where you need to set up a sub domain and then point your domain name at the sub domain. I’ve never really liked this set-up as things can quickly become messy, and you can accidentally delete a whole site simply by deleting the wrong folder.

I was considering getting a VPS system but they can be a little expensive. It was while looking at these that I discovered TSO Host. The Clustered Platform is a hydrid system that has many of the benefits of a VPS or dedicated server but at a lower cost.

They have designed their own grid hosting control system from the ground up, which employs load balancing to spread your sites across a cluster of web servers, and ensure that no one site will hog all the resources. This system is capable of running-high traffic volume sites smoothly without costing you an arm and leg.

The user control panel is also a custom one which is very easy to use, allowing you to set up new websites, databases, ftp accounts, cron jobs and so on. On logging in you are greeted with an area where you can access all your current sites or create a new site.

TSO Host Control Panel Main Screen

Setting up a new site is just a matter of entering your domain name and clicking ‘G’o. You can then select whether you want it hosted on Linux, Windows or even a combination of both. Now simply point your domain to TSO Host’s Name Servers and upload your site files.

Each site will have it’s own control panel accessible from your main account control panel, where you can access Email, website settings, statistics and preview your site. I find this system a lot nicer and simpler to use than cpanel when hosting multiple sites.

TSO Host Control Panel Site Details


TSO Host Control Panel Site Settings

So if you are looking for a reliable, professional web hosting company for hosting multiple websites and at a reasonable price then I suggest you pay TSO Host a visit.

At the time of writing Shared Hosting starts at £14.99 a year (cpanel), and the Clustered Platform just £19.99 a month (Custom Control Panel).

TSO Host Banner