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 December, 2007

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

Creating an RSS Feed

RSS feeds are xml files updated on a regular basis which people subscribe to within RSS readers. The information carried on them is normally up to date and they are normally found on news sites and blogs, basically sites which are updated regularly and which people might like to be up to date with. In this article I will go through creating an RSS feed; they can be created in two forms: dynamic - this is where dynamic server side pages are created to query databases to display the new information automatically and require no manual intervention for the data to be displayed; manual - this is where a basic xml file is created and which has to be updated manually.

The Basic RSS Format

RSS feeds are made up of several different elements and tags which create the final document. The following is an example of an RSS feed:

As you can see the XML version used is the first thing to be declared within the document, the second being the beginning of the RSS tag which means the beginning of the feed; including both of these within your feed is important since a browser will use these to work out that it is an XML file which contains an RSS feed. Click here for an example of an RSS 2.0 feed.
The feed itself is contained within a ‘channel’ tag - some browsers output RSS feeds into a styled, readable format and this tag is important to ensure that browsers which have this capability are able to render your feed in this way. The first few lines within this tag describe your feed and contain information such as the title of the feed, a description of it, the language in which it is written as well as the last time it was updated.

After that the different items of the feed are shown - these are displayed within ‘item’ tags and there is no limit on the amount of these which you can have in one feed. The basics needed to structure an ‘item’ tag are the ‘title’ and ‘description’ tags which ensure that the item is outputted into a readable format.

Dynamic RSS Feeds

Feeds of this type require a server side page such as a PHP or ASP page be created to query a database so that the up to date information be displayed. This process requires no manual intervention and is completely automatic. To begin with you need to make sure that your page is outputted to the browser as an XML document, to do this you will need to add a header response line to the top of your page, and make sure that it outputs the page in the ‘text/xml’ format. The rest of the feed is outputted like the example above, except
Manual RSS Feeds

These feeds are ‘.xml’ files which are updated manually and always take the form of the feed displayed within the first section of this article. You should only opt for this type of feed if you aren’t going to update often as updating it can be a timely procedure.

Comments (3) 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

Important Terms Within the Hosting Business - A

ActiveX

This is a control commonly used within Microsoft’s Internet Explorer web browser. They are very similar to applets in the way they behave as well as their functionalities; however, they give developers greater access to a client’s system - applets only provide developers with very limited access.

ADSL

ADSL stands for Asymmetric Digital Subscribers Line. It is similar to a DSL line, the only difference being that a number if dialled on connection with an ADSL connection.

Applets

These are very similar to ActiveX controls. Unline ActiveX controls they can be run in most browsers but provide developers with limited access to a client’s system as they are executed within a sandbox. They are normally written in the Java programming language.

ARPANET

ARPANET is a project which began in 1969 and was started by the Advanced Research Projects Agency with the aim of linking up 4 universities. The project became well known for being the start of the internet.

ASCII

ASCII stands for American Standard Code for Information Interchange. It is a data representation code used mainly by microcomputers and minicomputers.

ATM

ATM stands for Asynchronous Transfer Mode. It is a network configuration utilizing a single standard for data, video and audio that transfers information in short, fixed-length packets.

Access

Access is Microsoft’s advanced database creation and management software. It is popular among developers who maintain online databases with Windows NT.

Aliased Nameservers

Aliased nameservers are nameservers which are in the name of the client and not that of the hosting provider.

Apache

Apache is a free open source webserver widely used on the internet.

Application Hosting Service Provider

This is a third party provider which manages software applications.

Comments Bookmark on del.icio.us

Web Hosting Need for Web Designers

Hosting Need for Web Designers

Either you’re a professional web designer or inexperienced, you come across several time the webmaster for whom you are designing sites are seeking for a best web hosting account, if you work for the one best hosting company around it will add value to your service since you are also considering for helping your clients to get hosting account. In return you can earn considerable revenues apart from your designing services by signing up the affiliate program of a reputed hosting providers.

Of course to get familiar with particular hosting services about their support, features you will consider for hosting your site too for running your business as well properly. To recommend some one else, you need honest approach and should have utilized a variety of options meeting your own hosting needs from a reliable hosting provider. You can develop a good network through relationship with the people you recommend with your honest opinion as these customers will come again for any designing need in future. Eukhost is always with you to meet your specific need, as they love catering to web designers and web developers by adding them to their team!

-Paul

Comments Bookmark on del.icio.us

« Previous entries · Next entries »