LOW COST JAVA PHP MYSQL CGI PERL
HOSTING SERVICE
LINUX WINDOWS CPANEL WHM PLESK
HOSTING PACKAGES
ECOMMERCE HOSTING ASP JSP MSSQL
FRONTPAGE HOSTING
CPANEL WHM RESELLER DEDICATED
SERVER WEB HOSTING

Archive for PHP Web Hosting

Starting Your First Blog

Blogs are online journals in which people write about things - whether it be the ramblings of their life or tutorials to help others along. The word ‘blog’ comes from the word ‘weblog’, and has many words which derive from it; these words being: blogger and blogging. The word blogger is the name given to the author of the blog, and blogging the name given to the process of writing to a blog; the world blog can also refer to the process of writing to a blog. Blogs have been becoming more popular over the last 2 years, and as of July 2007 there are around 70 million active blogs on the internet. If you are looking to start your own blog, there is no time better than now to do so.

To start your own blog, there are certain factors which you need to work out before you start anything, there are:

  • What you are going to blog about.
  • Your intended target audience.
  • The name of your blog.
  • Whether you are going to use a free or paid blogging service.
  • If you are going to pay for a hosting service: what blog software you are going to use.

What You Are Going to Blog About

The most important factor to consider when starting your own blog is what you are going to blog about; this is because the content of the blog will determine how successful it is: if you write about personal stuff then your blog is not going to gain much traffic, as the only visitors will probably only be friends or family; if you write posts which will help others out in any way then they are most likely to recommend your blog to others which means that it will gradually gain traffic.

Identifying Your Intended Target Audience

Once you have worked out what you are going to blog about, you need to work out who is most likely to visit your blog, and why; this is important because when you come to promoting your blog, you want to make sure that you are promoting it to the right group of people. This also plays a huge part in the amount of visitors that you receive; if it’s only family and friends visiting your blog then the amount of traffic that you receieve won’t be a huge amount, however, if people are finding and visiting your blog from web searches then they are most likely to be returning visitors, and will recommend your blog to others.

The Name of Your Blog

You can name your blog anything you want, you can even name it after yourself. However, most blog names are normally linked to the blog’s subject in some way or another. The name of your blog must be simple to say, and easy to remember; simple names are more likely to stick in people’s heads which means that if people can remember the name and address of your blog then they will most likely recommend it to others.

Using a Free or Paid Service

There are many different services which you could use to host your blog. You could use a free service which gives you a sub of their main domain name; the main downside of free blog hosting services is that they normally fill your blog with unwanted adverts. The following is a list of free blog hosting services which you can use to help get you started:

  • http://www.blogger.com/ - Blogger is Google’s free blog hosting service. It is one of the most popular in the world. The adverts that they place are rather discrete and blend in with the chosen design. The address given is normally ‘blogname.blogspot.com’.
  • http://www.cjb.net/ - CJB.net run a free blog hosting service along with a range of other free services. Adverts placed by them aren’t that discrete and don’t blend in with the blog. The url provided is normally ‘http://blogs.cjb.net/blogname’.
  • http://www.wordpress.com/ - Witth Wordpress.com you can create your own instance of the popular open source WordPress blog system, but hosted on their servers. The url provided is normally ‘blogname.wordpress.com’.

If you are not tempted to use a free blog hosting service, then you buy a cheap web hosting package with a web host along with a domain. With paid blog/hosting services you have full control of your blog and don’t have forced advertisements displayed. You can then install one of the following free blog software packages:

  • http://www.wordpress.org/ - Wordpress is the world’s most popular open source blog system.
  • http://www.b2evolution.net/ - B2Evolution is another piece of popular blog software. It is different from Wordpress in the way that you are able to create multiple blogs within one installation.
  • http://www.mephistoblog.com/ - Mephisto is a relatively new piece of open source blog software. It is different from both Wordpress and B2Evo since it was written in the up and coming RoR scripting language.

Comments (2) Bookmark on del.icio.us

Creating Your First Website

Websites can be used for many different purposes; you can make a personal website about yourself where you may want to post family photos that you might want to share with friends and family, or you may want to build a business website so that you can sell your products online and promote your business through the means of the internet. Many people would love to be able to create their own website, but don’t necessarily have the knowledge to do so; although there are many web-based products which claim to let you build your own website, they don’t necessarily let you customize your website as much as you want since your are limited to certain templates- because of this you should always learn how to build your own website from scratch with HTML.

Learning Languages

To build the most basic of websites you need to start off by learning HTML and CSS. HTML is the basic language of all web pages - without it you won’t even be able to create one page. CSS stands for ‘Cascading Style Sheets’ and is the language used to style elements on a web page - you need to know this if you want to make your web pages look good. If you want to extend the features of your website to include something dynamic, such as a shopping cart then you will need to learn a server side web language such as PHP or ASP.

There are many resources on the internet that you can use to learn web languages, including:

  • http://www.w3schools.com - This site has tutorials for languages which are widely used on the internet. This resource if perfect to get your from being a novice to having intermediate knowledge of web languages.
  • http://www.4guysfromrolla.com/ - This site has many different articles, tutorials and code examples which can help you to learn ASP.NET, and its older sister - classic ASP.
  • http://uk3.php.net/tut.php - PHP.net - the home website of the PHP scripting language has put together a simple tutorial to help out beginners.

Once you have learnt the basics of HTML and CSS, you are ready to start building your website.

Choosing the Design Software

When building a website you need to design what piece of software you will be using to do it. When choosing web design software, there are several variables that you should always take into consideration, these are: cost of the software, the complexity of the software and whether you are going to build using your own code or by using a WYSIWYG (what you see is what you get) editor. Website design software can range from nothing to around £500; if you are going to be building your site using your own code then you have no need for a WYSIWYG editor meaning that all you need is a text application, such as Microsoft Notepad or jEdit - a piece of software specifically built for this kind of scenario. If you are after a piece of software which you would like to do all the coding for you and that lets you see the final outcome without having to do anything complicated then you want a piece of software which is known as a ‘WYSIWYG’ editor; these pieces of software generally cost, and examples include NetObject’s Fusion and Adobe’s Dreamweaver. WYSIWYG editors are generally more complicated to use than normal text editors since they have more built in features to help someone along with the building of their site. Listed below are some of the most commonly used website design programs:

  • http://www.microsoft.com/express/vwd/Default.aspx - Microsoft Visual Web Developer Express Edition is a free piece of Microsoft software created to encourage more developers and designers alike to take up ASP.NET coding. It can be used as both a WYSIWYG editor and a plain text editor, and has many features built in.
  • http://msdn2.microsoft.com/en-gb/vstudio/default.aspx - Microsoft Visual Studio is VWD’s bigger brother and it’s costs vary since there are various different editions of it.
  • http://www.jedit.net/ - jEdit is a free plain text editor that was created specifically for web designers. You can use it to script in any language, but it doesn’t come with a WYSIWYG editor.
  • http://www.adobe.com/products/dreamweaver/ - Adobe Dreamweaver (formally Macromedia Dreamweaver) is probably the best known piece of website design software throughout the world. It comes with both a code editor and a WYSIWYG editor, but is quite costly priced at $399 (approximately £199).

Getting Your Website onto the Internet

Getting your website onto the internet doesn’t have to be the complicated process that many make it out to be. All you need to do is purchase a domain and website hosting and you are all set to go. A domain is the address which you type in to go to a website - the cost of these is relatively low as you can pick a domain up for about £5/year these days; web hosting as well is relatively cheap as in most cases you pick a package up for £22.99/year. After you have purchased both of these you should be given access to an online system known as a ‘control panel’ where you can control all aspects of your website and its hosting.

To upload your website to your web space all you need to do is establish an FTP connection with the FTP server for your site (normally ftp://ftp.yourdomain.com). You will be asked to login with your FTP account - these can normally be created through your control panel. Once a connection has been established you have to copy your website files into the root of your website, this is a folder normally named ‘public_html’ under Linux hosting or ‘httpdocs’ if you are on Windows hosting.

Once the files have been copied, all you need to do is open a fresh browser window, type your domain into the address bar and your website should appear as if by magic!

Promoting Your Website

You’ve got your website completed and on the web now. The next thing to do is to get your website promoted so that you can start receiving visitors. You can submit your website online directories under a category that fits your website and sign up to online advertising services so that your website will be advertised on other websites; you should also make sure that your website is listed in the results of popular search engines such as MSN, Google, and Yahoo - this will ensure that your website receives visitors. You should find the links below helpful when promoting your website:

  • http://www.google.com/adwords/ - Google AdWords is Google’s advertiser network which is known as a PPC (pay per click) program where you can create your own adverts for your website which will be then shown on the websites of Google publisher’s.
  • http://www.url-free.net/ - This is a prime example of a website directory where you can submit your website to a certain category where it can then be found by others who are browsing the category.

Comments (2) Bookmark on del.icio.us

Javascript Basics

Javascript is a client-side scripting language which can be used to manipulate client’s browsers as well as to fetch information on a client’s machine. However, Javascript has only been used in it’s intended way recently, this is because since it’s launch back in the ’90s it has been used by spammers, hackers and virus makers to compromise client machines. The most common use of Javascript at this moment in time is for popup adverts - something which more browsers are beginning to put blocks on.

The most up to date use of Javascript has been in the creating of AJAX. AJAX is a mixture of other languages as well as Javascript which allows data to be posted back to a server without the need for pages to be reloaded. To learn more about AJAX, click here.
However good Javascript may seem to be, it has its limitations, the main one being that older browsers don’t support it.

Creating Your First Javascript

Javascript functions are located within the ‘function()’ tag. These functions can be delcared in two ways: by creating a function with its own names and variables that can be called again at any time within a script, this would be delcared in the following format: ‘function function_name(var1, var2, var3)’; functions can also be called directly which means that they can’t be used again within a script unless the code is copied since the function isn’t assigned a name, a function of this type would be declared in the following format: ‘var variable = function()’.

Any code for a function, or any part of the scipt is located within the opening and closing tags, for javascript these being ‘{’ as the opening tag and ‘}’ as the closing tag.

Variables for a function are located in the brackets after a function name - these variables are set directly each time the function is called, and can be different each time. Variables can also be set directly within a function, but these variables can’t be different each time; these variables are set using the ‘var’ tag.

Basic Page and Browser Manipulation

The main use of javascript is to manipulate client machines and web browsers - it can also be used to manipulate web pages. Browsers can be manipulated in ways that include resizing browser windows, opening new windows with custom settings as well as creating transition effects inbetween web pages.

Opening new windows with javascript is simple as there is the built in ‘window.open’ function; the variables of this function take the following form: ‘window.open(url, windowname[, variables]). Javascript can also be used to close windows by using the ‘window.close’; to use this function you can either close another window, or you can close the window which currently open. To close another window you will need to use the function in this format: ‘windowname.close();’, to close the window which is currently open you need to the function in this format: ’self.close();’.

Page transitions can be achieved with the use of special meta-tags within the ‘head’ section of a page. However, page transitions only work with Internet Explorer. To use page transitions youn will need to add a meta-tag named ‘Page-Enter’ if you want to use effects when someone enters the page, and a tag named ‘Page-Exit’ if you want effects to be used when someone leaves a page. The ‘Content’ part of the meta-tags needs to contain the information that will trigger the effects; to trigger them they will need to be wrapped in the ‘RevealTrans’ tag in the following format: ‘RevealTrans (Duration=Duration, Transition=TransitionNumber)’. The duration can be set in the tag, as well as the transition used; the transitions don’t go by name but by number; click here for a list of transitions and the numbers related to them.

Javascript can also be used to change a browser’s location. To do this the following code must be placed within a function which must be called within the ‘onLoad’ tag of the body tag of a web page: ‘window.location.href = ‘location’;’.

Comments (3) Bookmark on del.icio.us

AJAX Basics

A stands for Achronymous Javascript and XML; it is the latest technology which is taking the Web 2.0 world by storm. AJAX can’t really be considered a new technology as it utilizes existing technologies - those being Javascript and XML. The main use of AJAX is ton query a database or to submit a form without the need to do a postback or to reload the page concerned. Although AJAX may seem to be just a thing to use if you want to make sure site all cool and fancy, it has advantages for developers as well; by using less postbacks within a website, less bandwidth is used which keeps costs down for the developer.

Creating Your First AJAX Page

To begin with, your ‘front-end’ page can be in any scripting language - it can even be just a basic HTML file. However, your ‘back-end’ page needs to be written in a dynamic scripting language which is able to query a database, accept querystring data - basically anything which requires access to a server or needs to fetch client-side data; examples of these kind of languages include PHP and ASP. If you are new to the concept of server side scripting then I recommend that you start at somewhere like http://www.w3schools.com/ where you will be able to pick up the basics of several server-side scripting languages.

You will need a Javascript written which is able to create XML objects within a browser and must be then able to post information back to your ‘back-end’ page. For this article I have created a Javascript which the rest of the article will be based on; click here to download it.

The Javascript Function

The main AJAX script itself is made up of 2 different functions: fetchData() and filterData(). The hard work is done by the fetchData() function becuase as you can see the XMLHttpRequests are created within the function - also the code used to send the data is located within this function - this code being located within the ‘if (dataToSend)’ segment of the function.

The fetchData() function is made up of three variables which must be defined: url, dataToSend and objectID; the url variable is the path to your ‘back-end’ page where all the hard work is done, the ‘dataToSend’ variable is the data that you want to be sent to the ‘back-end’ page - this will be sent over a query string, and the objectID is the div or table cell on the ‘front-end’ page which you want to be filled with the data/response from the back-end page.

The Back-End Page

For an AJAX post back to work, you need to create a ‘back-end’ page in a dynamic scripting language. This page can be created in any dynamicscripting language as long as it supports fetching data from querystrings. Any data posted back to the page will be located within the ’sendData’ query string element.

The Front-End Page

To initiate an AJAX post back, you need to create a basic link element, but the hyperlink reference needs to be in the following form: ‘javascript: fetchData(url, dataToSend, objectID)’. The variables of the function are described within the ‘Javascript Function’ paragraph above here. If you create a normal link with the hyperlink reference taking the form of the example given then you should have a working AJAX post-back link.
Customizing the Fetch Response

You may want to customize the response received whilse the data is being fetched. The code which determines the response is located within the filterData() function. The response received could be replaced with something like ‘Loading…’ or similar - the text or image displayed is completely up to you.

The lines which determine the responses are located within the segments of the script which determine the status code received (pageRequest.readyState == 0,1,2,3,4 - the numbers go up in stages). Each of those segments contain the line ‘objectID.innerHTML’; this shows that the response changes the HTML within the desired object, meaning that you have the freedom to change the response as much as you would like.

Comments (2) Bookmark on del.icio.us

Installing Apache, MySQL and PHP on a Linux Server in Under 10 Minutes

Apache, MySql and PHP; these three products are open source programs available for use on most well known operating systems. In this article I will explain how you can install Apache, MySql and PHP on a Linux box using yum in under 10 minutes.

1 - Checking and Removing Any Existing Installations of the 3 of Them

Run the following command to make sure that any existing installations of Apache, MySql or PHP are removed:

yum -y remove httpd mysqld mysql-server php

2 - Installing Apache

Run the following to install the Apache web server:

yum -y install httpd

3 - Installing MySql Server

Run the following command to install MySql Server:

yum -y install mysqld mysql-server

4 - Install PHP

Run the following command to install PHP:

yum -y install php php-mysql

5 - Installing PHP Libraries

PHP has many different libraries and add-ons which you want or need to utilize; in your case we want to install the PHP GD image library and the PHP IMAP library, to do this we’ll be using the following command:

yum -y install php-gd php-imap

Thats it - you have now AMP’d a server! All you need to do now is start the individual services, to do this run the following commands (individually):

service httpd start

service mysqld start

PHP will be seen by Apache as a library and so does not need to be started.

Comments (1) Bookmark on del.icio.us

extension_loaded() in PHP

PHP 3 and above supports function extension_loaded() which findx out whether a extension is loaded or not.
syntax : bool extension_loaded ( string name )

This function returns TRUE if the extension identified by name is loaded, FALSE otherwise.

This function is not much used in the simple coding of small websites, but when applications are created then for finding out the different extensions loaded with PHP on individual systems this function is used.

For example, if one want to find out whether ‘gd’ has been installed then use this function as follows :
<?php
if (extension_loaded(’gd’))
echo “GD installed”;
else
echo “GD not installed”;
?>

We can use this code on any web page if want to find out if GD support is enabled on our server or not. Nowadays, many servers require GD support for using different image functions of PHP.

There are a number of extensions used in PHP; all the extensions can be found using phpinfo().

Comments Bookmark on del.icio.us

« Previous entries · Next entries »