Sunday, October 19, 2008

XForms Tutorial

XForms is the next generation of HTML forms.

In our XForms tutorial you will learn how to start using XForms in your applications.

What You Should Already Know

Before you continue you should have a basic understanding of the following:

* HTML
* HTML Forms
* XHTML
* XML
What Is XForms?

* XForms is the next generation of HTML forms
* XForms is richer and more flexible than HTML forms
* XForms will be the forms standard in XHTML 2.0
* XForms is platform and device independent
* XForms separates data and logic from presentation
* XForms uses XML to define form data
* XForms stores and transports data in XML documents
* XForms contains features like calculations and validations of forms
* XForms reduces or eliminates the need for scripting
* XForms is a W3C Recommendation

XForms Is The Successors Of HTML Forms

Forms are an important part of many web applications today. An HTML form makes it possible for web applications to accept input from a user.

Today, ten years after HTML forms became a part of the HTML standard, web users do complex transactions that are starting to exceed the limitations of standard HTML forms.

XForms provides a richer, more secure, and device independent way of handling web input. We should expect future web solutions to demand the use of XForms-enabled browsers (All future browsers should support XForms).
XForms Separate Data From Presentation

XForms uses XML for data definition and HTML or XHTML for data display. XForms separates the data logic of a form from its presentation. This way the XForms data can be defined independent of how the end-user will interact with the application.
XForms Uses XML To Define Form Data

With XForms, the rules for describing and validating data are expressed in XML.
XForms Uses XML To Store And Transport Data

With XForms, the data displayed in a form are stored in an XML document, and the data submitted from the form, are transported over the internet using XML.

The data content is coded in, and transported as Unicode bytes.
XForms Is Device Independent

Separating data from presentation makes XForms device independent, because the data model can be used for all devices. The presentation can be customized for different user interfaces, like mobile phones, handheld devices, and Braille readers for the blind.

Since XForms is device independent and based on XML, it is also possible to add XForms elements directly into other XML applications like VoiceXML (speaking web data), WML (Wireless Markup Language), and SVG (Scalable Vector Graphics).

Sunday, October 12, 2008

SOAP Summary

SOAP Summary

This tutorial has taught you how to use SOAP to exchange information between applications over HTTP.

You have learned about the different elements and attributes in a SOAP message.

You have also learned how use SOAP as a protocol for accessing a web service.
Now You Know SOAP, What's Next?

The next step is to learn about WSDL and Web Services.

WSDL

WSDL is an XML-based language for describing Web services and how to access them.

WSDL describes a web service, along with the message format and protocol details for the web service.

If you want to learn more about WSDL, please visit our WSDL tutorial.

SOAP Tutorial

SOAP is a simple XML-based protocol to let applications exchange information over HTTP.

In our SOAP tutorial, you will learn what SOAP is, and how it uses XML to exchange information between applications.

What is SOAP?

* SOAP stands for Simple Object Access Protocol
* SOAP is a communication protocol
* SOAP is for communication between applications
* SOAP is a format for sending messages
* SOAP is designed to communicate via Internet
* SOAP is platform independent
* SOAP is language independent
* SOAP is based on XML
* SOAP is simple and extensible
* SOAP allows you to get around firewalls
* SOAP will be developed as a W3C standard

Why SOAP?

It is important for application development to allow Internet communication between programs.

Today's applications communicate using Remote Procedure Calls (RPC) between objects like DCOM and CORBA, but HTTP was not designed for this. RPC represents a compatibility and security problem; firewalls and proxy servers will normally block this kind of traffic.

A better way to communicate between applications is over HTTP, because HTTP is supported by all Internet browsers and servers. SOAP was created to accomplish this.

SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.
Microsoft and SOAP

SOAP is a key element of Microsoft's .NET architecture for future Internet application development.
SOAP 1.1 was Proposed to W3C

UserLand, Ariba, Commerce One, Compaq, Developmentor, HP, IBM, IONA, Lotus, Microsoft, and SAP proposed to W3C, in May 2000, the SOAP Internet protocol that they hope will revolutionize application development by connecting graphic user interface desktop applications to powerful Internet servers using the standards of the Internet: HTTP and XML.

Monday, October 6, 2008

AJAX Tutorial

AJAX stands for Asynchronous JavaScript And XML.

AJAX is a type of programming made popular in 2005 by Google (with Google Suggest).

AJAX is not a new programming language, but a new way to use existing standards.

With AJAX you can create better, faster, and more user-friendly web applications.

AJAX = Asynchronous JavaScript and XML

AJAX is not a new programming language, but a technique for creating better, faster, and more interactive web applications.

With AJAX, your JavaScript can communicate directly with the server, using the JavaScript XMLHttpRequest object. With this object, your JavaScript can trade data with a web server, without reloading the page.

AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages.

The AJAX technique makes Internet applications smaller, faster and more user-friendly.

lamp AJAX is a browser technology independent of web server software.


AJAX is Based on Web Standards

AJAX is based on the following web standards:

  • JavaScript
  • XML
  • HTML
  • CSS

The web standards used in AJAX are well defined, and supported by all major browsers. AJAX applications are browser and platform independent.


AJAX is About Better Internet Applications

Web applications have many benefits over desktop applications; they can reach a larger audience, they are easier to install and support, and easier to develop.

However, Internet applications are not always as "rich" and user-friendly as traditional desktop applications.

With AJAX, Internet applications can be made richer and more user-friendly.


AJAX can be used for interactive communication with a database.


AJAX Database Example

In the AJAX example below we will demonstrate how a web page can fetch information from a database using AJAX

As you can see it is just a simple HTML form with a drop down box called "customers".

The paragraph below the form contains a div called "txtHint". The div is used as a placeholder for info retrieved from the web server.

When the user selects data, a function called "showCustomer()" is executed. The execution of the function is triggered by the "onchange" event. In other words: Each time the user change the value in the drop down box, the function showCustomer is called.




Friday, September 26, 2008

The Semantic Web



A Web with a meaning."If HTML and the Web made all the online documents look like one huge book, RDF, schema, and inference languages will make all the data in the world look like one huge database"

Tim Berners-Lee, Weaving the Web, 1999


What Is The Semantic Web?

The word semantic stands for the meaning of. The semantic of something is the meaning of something.

The Semantic Web is a web that is able to describe things in a way that computers can understand.

  • The Beatles was a popular band from Liverpool.
  • John Lennon was a member of the Beatles.
  • The record "Hey Jude" was recorded by the Beatles.

Sentences like these can be understood by people. But how can they be understood by computers?

Statements are built with syntax rules. The syntax of a language defines the rules for building the language statements. But how can syntax become semantic?

This is what the Semantic Web is all about. Describing things in a way that computers applications can understand.

The Semantic Web is not about links between web pages.

The Semantic Web describes the relationships between things (like A is a part of B and Y is a member of Z) and the properties of things (like size, weight, age, and price)

ASP Tutorial


In our ASP tutorial you will learn about ASP, and how to execute scripts on your server.

You will see that ASP is a powerful tool for making dynamic and interactive Web pages.


An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are executed on the server

What you should already know

Before you continue you should have some basic understanding of the following:

  • HTML / XHTML
  • A scripting language like JavaScript or VBScript

What is ASP?

  • ASP stands for Active Server Pages
  • ASP is a program that runs inside IIS
  • IIS stands for Internet Information Services
  • IIS comes as a free component with Windows 2000
  • IIS is also a part of the Windows NT 4.0 Option Pack
  • The Option Pack can be downloaded from Microsoft
  • PWS is a smaller - but fully functional - version of IIS
  • PWS can be found on your Windows 95/98 CD

ASP Compatibility

  • ASP is a Microsoft Technology
  • To run IIS you must have Windows NT 4.0 or later
  • To run PWS you must have Windows 95 or later
  • ChiliASP is a technology that runs ASP without Windows OS
  • InstantASP is another technology that runs ASP without Windows

What is an ASP File?

  • An ASP file is just the same as an HTML file
  • An ASP file can contain text, HTML, XML, and scripts
  • Scripts in an ASP file are executed on the server
  • An ASP file has the file extension ".asp"

How Does ASP Differ from HTML?

  • When a browser requests an HTML file, the server returns the file
  • When a browser requests an ASP file, IIS passes the request to the ASP engine. The ASP engine reads the ASP file, line by line, and executes the scripts in the file. Finally, the ASP file is returned to the browser as plain HTML

What can ASP do for you?

  • Dynamically edit, change or add any content of a Web page
  • Respond to user queries or data submitted from HTML forms
  • Access any data or databases and return the results to a browser
  • Customize a Web page to make it more useful for individual users
  • The advantages of using ASP instead of CGI and Perl, are those of simplicity and speed
  • Provide security since your ASP code can not be viewed from the browser
  • Clever ASP programming can minimize the network traffic



AJAX Tutorial




AJAX stands for Asynchronous JavaScript And XML.

AJAX is a type of programming made popular in 2005 by Google (with Google Suggest).

AJAX is not a new programming language, but a new way to use existing standards.

With AJAX you can create better, faster, and more user-friendly web applications.

AJAX is based on JavaScript and HTTP requests.

AJAX stands for Asynchronous JavaScript And XML.

What You Should Already Know

Before you continue you should have a basic understanding of the following:

  • HTML / XHTML
  • JavaScript

AJAX = Asynchronous JavaScript and XML

AJAX is not a new programming language, but a technique for creating better, faster, and more interactive web applications.

With AJAX, your JavaScript can communicate directly with the server, using the JavaScript XMLHttpRequest object. With this object, your JavaScript can trade data with a web server, without reloading the page.

AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages.

The AJAX technique makes Internet applications smaller, faster and more user-friendly.

lamp AJAX is a browser technology independent of web server software.


AJAX is Based on Web Standards

AJAX is based on the following web standards:

  • JavaScript
  • XML
  • HTML
  • CSS

The web standards used in AJAX are well defined, and supported by all major browsers. AJAX applications are browser and platform independent.


AJAX is About Better Internet Applications

Web applications have many benefits over desktop applications; they can reach a larger audience, they are easier to install and support, and easier to develop.

However, Internet applications are not always as "rich" and user-friendly as traditional desktop applications.

With AJAX, Internet applications can be made richer and more user-friendly.

AJAX stands for Asynchronous JavaScript And XML.


What You Should Already Know

Before you continue you should have a basic understanding of the following:

  • HTML / XHTML
  • JavaScript

If you want to study these subjects first, find the tutorials on our Home page.


AJAX = Asynchronous JavaScript and XML

AJAX is not a new programming language, but a technique for creating better, faster, and more interactive web applications.

With AJAX, your JavaScript can communicate directly with the server, using the JavaScript XMLHttpRequest object. With this object, your JavaScript can trade data with a web server, without reloading the page.

AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages.

The AJAX technique makes Internet applications smaller, faster and more user-friendly.

lamp AJAX is a browser technology independent of web server software.


AJAX is Based on Web Standards

AJAX is based on the following web standards:

  • JavaScript
  • XML
  • HTML
  • CSS

The web standards used in AJAX are well defined, and supported by all major browsers. AJAX applications are browser and platform independent.


AJAX is About Better Internet Applications

Web applications have many benefits over desktop applications; they can reach a larger audience, they are easier to install and support, and easier to develop.

However, Internet applications are not always as "rich" and user-friendly as traditional desktop applications.

With AJAX, Internet applications can be made richer and more user-friendly.

DHTML Tutorial



DHTML is NOT a language.

DHTML is a TERM describing the art of making dynamic and interactive web pages.

DHTML combines HTML, JavaScript, DOM, and CSS.

HTML DOM Tutorial



The HTML Document Object Model (HTML DOM) defines a standard way for accessing and manipulating HTML documents.

The DOM presents an HTML document as a tree-structure (a node tree), with elements, attributes, and text.

DOM HTML tree

What is the DOM?

The DOM is a W3C (World Wide Web Consortium) standard.

The DOM defines a standard for accessing documents like HTML and XML:

"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."

The DOM is separated into 3 different parts / levels:

  • Core DOM - standard model for any structured document
  • XML DOM - standard model for XML documents
  • HTML DOM - standard model for HTML documents

The DOM defines the objects and properties of all document elements, and the methods (interface) to access them.


What is the XML DOM?

The XML DOM defines the objects and properties of all XML elements, and the methods (interface) to access them.

If you want to study the XML DOM, find the XML DOM tutorial on our homepage.


What is the HTML DOM?

The HTML DOM is:

  • A standard object model for HTML
  • A standard programming interface for HTML
  • Platform- and language-independent
  • A W3C standard

The HTML DOM defines the objects and properties of all HTML elements, and the methods (interface) to access them.

In other words:

The HTML DOM is a standard for how to get, change, add, or delete HTML elements.

JavaScript Tutorial

JavaScript is THE scripting language of the Web.

JavaScript is used in millions of Web pages to add functionality, validate forms, detect browsers, and much more.

JavaScript is easy to learn! You will enjoy it!


JavaScript is used in millions of Web pages to improve the design, validate forms, detect browsers, create cookies, and much more.

JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, and Opera.


What You Should Already Know

Before you continue you should have a basic understanding of the following:

  • HTML / XHTML

If you want to study these subjects first, find the tutorials .


What is JavaScript?

  • JavaScript was designed to add interactivity to HTML pages
  • JavaScript is a scripting language
  • A scripting language is a lightweight programming language
  • JavaScript is usually embedded directly into HTML pages
  • JavaScript is an interpreted language (means that scripts execute without preliminary compilation)
  • Everyone can use JavaScript without purchasing a license

Are Java and JavaScript the Same?

NO!

Java and JavaScript are two completely different languages in both concept and design!

Java (developed by Sun Microsystems) is a powerful and much more complex programming language - in the same category as C and C++.


What can a JavaScript Do?

  • JavaScript gives HTML designers a programming tool - HTML authors are normally not programmers, but JavaScript is a scripting language with a very simple syntax! Almost anyone can put small "snippets" of code into their HTML pages
  • JavaScript can put dynamic text into an HTML page - A JavaScript statement like this: document.write("

    " + name + "

    ") can write a variable text into an HTML page
  • JavaScript can react to events - A JavaScript can be set to execute when something happens, like when a page has finished loading or when a user clicks on an HTML element
  • JavaScript can read and write HTML elements - A JavaScript can read and change the content of an HTML element
  • JavaScript can be used to validate data - A JavaScript can be used to validate form data before it is submitted to a server. This saves the server from extra processing
  • JavaScript can be used to detect the visitor's browser - A JavaScript can be used to detect the visitor's browser, and - depending on the browser - load another page specifically designed for that browser
  • JavaScript can be used to create cookies - A JavaScript can be used to store and retrieve information on the visitor's computer

The Real Name is ECMAScript

JavaScript's official name is "ECMAScript". The standard is developed and maintained by the ECMA organisation.

ECMA-262 is the official JavaScript standard. The standard is based on JavaScript (Netscape) and JScript (Microsoft).

The language was invented by Brendan Eich at Netscape (with Navigator 2.0), and has appeared in all Netscape and Microsoft browsers since 1996.

The development of ECMA-262 started in 1996, and the first edition of was adopted by the ECMA General Assembly in June 1997.

The standard was approved as an international ISO (ISO/IEC 16262) standard in 1998.

The development of the standard is still in progress.

XML Tutorial

XML stands for EXtensible Markup Language.

XML was designed to transport and store data.

In this tutorial you will learn about XML, and the difference between XML and HTML.

XML is important to know, and very easy to learn.

XML was designed to transport and store data.

HTML was designed to display data.


What You Should Already Know

Before you continue you should have a basic understanding of the following:

  • HTML
  • JavaScript

If you want to study these subjects first, find the tutorials on our Home page.


What is XML?

  • XML stands for EXtensible Markup Language
  • XML is a markup language much like HTML
  • XML was designed to carry data, not to display data
  • XML tags are not predefined. You must define your own tags
  • XML is designed to be self-descriptive
  • XML is a W3C Recommendation

The Difference Between XML and HTML

XML is not a replacement for HTML.
XML and HTML were designed with different goals:

XML was designed to transport and store data, with focus on what data is.
HTML was designed to display data, with focus on how data looks.

HTML is about displaying information, while XML is about carrying information.


XML Does not DO Anything

Maybe it is a little hard to understand, but XML does not DO anything. XML was created to structure, store, and transport information.

The following example is a note to Tove from Jani, stored as XML:


Tove
Jani
Reminder
Don't forget me this weekend!

The note above is quite self descriptive. It has sender and receiver information, it also has a heading and a message body.

But still, this XML document does not DO anything. It is just pure information wrapped in tags. Someone must write a piece of software to send, receive or display it.


XML is Just Plain Text

XML is nothing special. It is just plain text. Software that can handle plain text can also handle XML.

However, XML-aware applications can handle the XML tags specially. The functional meaning of the tags depends on the nature of the application.


With XML You Invent Your Own Tags

The tags in the example above (like and ) are not defined in any XML standard. These tags are "invented" by the author of the XML document.

That is because the XML language has no predefined tags.

The tags used in HTML (and the structure of HTML) are predefined. HTML documents can only use tags defined in the HTML standard (like

,



XML is Not a Replacement for HTML

XML is a complement to HTML.

It is important to understand that XML is not a replacement for HTML. In most web applications, XML is used to transport data, while HTML is used to format and display the data.

My best description of XML is this:

XML is a software and hardware independent tool for carrying information.


XML is a W3C Recommendation

The Extensible Markup Language (XML) became a W3C Recommendation 10. February 1998.


XML is Everywhere

We have been participating in XML development since its creation. It has been amazing to see how quickly the XML standard has developed and how quickly a large number of software vendors have adopted the standard.

XML is now as important for the Web as HTML was to the foundation of the Web.

XML is everywhere. It is the most common tool for data transmissions between all sorts of applications, and becomes more and more popular in the area of storing and describing information.


PhP tutorials





PHP is a powerful server-side scripting language for creating dynamic and interactive websites.

PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. PHP is perfectly suited for Web development and can be embedded directly into the HTML code.

The PHP syntax is very similar to Perl and C. PHP is often used together with Apache (web server) on various operating systems. It also supports ISAPI and can be used with Microsoft's IIS on Windows.

A PHP file may contain text, HTML tags and scripts. Scripts in a PHP file are executed on the server.


What You Should Already Know

Before you continue you should have a basic understanding of the following:

  • HTML / XHTML
  • Some scripting knowledge

If you want to study these subjects first, find the tutorials on our Home page.


What is PHP?

  • PHP stands for PHP: Hypertext Preprocessor
  • PHP is a server-side scripting language, like ASP
  • PHP scripts are executed on the server
  • PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
  • PHP is an open source software (OSS)
  • PHP is free to download and use

What is a PHP File?

  • PHP files may contain text, HTML tags and scripts
  • PHP files are returned to the browser as plain HTML
  • PHP files have a file extension of ".php", ".php3", or ".phtml"

What is MySQL?

  • MySQL is a database server
  • MySQL is ideal for both small and large applications
  • MySQL supports standard SQL
  • MySQL compiles on a number of platforms
  • MySQL is free to download and use

PHP + MySQL

  • PHP combined with MySQL are cross-platform (means that you can develop in Windows and serve on a Unix platform)

Why PHP?

  • PHP runs on different platforms (Windows, Linux, Unix, etc.)
  • PHP is compatible with almost all servers used today (Apache, IIS, etc.)
  • PHP is FREE to download from the official PHP resource: www.php.net
  • PHP is easy to learn and runs efficiently on the server side

Where to Start?

  • Install an Apache server on a Windows or Linux machine
  • Install PHP on a Windows or Linux machine
  • Install MySQL on a Windows or Linux machine

What do You Need?

This tutorial will not explain how to install PHP, MySQL, or Apache Server.

If your server supports PHP - you don't need to do anything! You do not need to compile anything or install any extra tools - just create some .php files in your web directory - and the server will parse them for you. Most web hosts offer PHP support.

However, if your server does not support PHP, you must install PHP. Below is a link to a good tutorial from PHP.net on how to install PHP5:

http://www.php.net/manual/en/install.php

Download PHP

Download PHP for free here: http://www.php.net/downloads.php


Download Apache Server

Download Apache for free here: http://httpd.apache.org/download.cgi

PHP Date - What is a Timestamp?

A timestamp is the number of seconds since January 1, 1970 at 00:00:00 GMT. This is also known as the Unix Timestamp.


PHP Date - Format the Date

The first parameter in the date() function specifies how to format the date/time. It uses letters to represent date and time formats. Here are some of the letters that can be used:

  • d - The day of the month (01-31)
  • m - The current month, as a number (01-12)
  • Y - The current year in four digits

An overview of all the letters that can be used in the format parameter, can be found in our PHP Date reference.

Other characters, like"/", ".", or "-" can also be inserted between the letters to add additional formatting:

";
echo date("Y.m.d");
echo "
";
echo date("Y-m-d");
?>

The output of the code above could be something like this:

2006/07/11
2006.07.11
2006-07-11


PHP Date - Adding a Timestamp

The second parameter in the date() function specifies a timestamp. This parameter is optional. If you do not supply a timestamp, the current time will be used.

In our next example we will use the mktime() function to create a timestamp for tomorrow.

The mktime() function returns the Unix timestamp for a specified date.

Syntax

mktime(hour,minute,second,month,day,year,is_dst)

To go one day in the future we simply add one to the day argument of mktime():


The output of the code above could be something like this:

Tomorrow is 2006/07/12


SQL Tutorials


What is MySQL?

MySQL is a database. A database defines a structure for storing information.

In a database, there are tables. Just like HTML tables, database tables contain rows, columns, and cells.

Databases are useful when storing information categorically. A company may have a database with the following tables: "Employees", "Products", "Customers" and "Orders".


Database Tables

A database most often contains one or more tables. Each table has a name (e.g. "Customers" or "Orders"). Each table contains records (rows) with data.

Below is an example of a table called "Persons":

LastName FirstName Address City
Hansen Ola Timoteivn 10 Sandnes
Svendson Tove Borgvn 23 Sandnes
Pettersen Kari Storgt 20 Stavanger

The table above contains three records (one for each person) and four columns (LastName, FirstName, Address, and City).


Queries

A query is a question or a request.

With MySQL, we can query a database for specific information and have a recordset returned.

Look at the following query:

SELECT LastName FROM Persons

The query above selects all the data in the LastName column in the Persons table, and will return a recordset like this:

LastName
Hansen
Svendson
Pettersen


Download MySQL Database

If you don't have a PHP server with a MySQL Database, you can download MySQL for free here: http://www.mysql.com/downloads/index.html