Advanced WML

Advanced WML

DOI: 10.4018/978-1-59140-769-0.ch007
OnDemand:
(Individual Chapters)
Available
$37.50
No Current Special Offers
TOTAL SAVINGS: $37.50

Abstract

Chapter VI discusses the creation of static web pages, which have a fixed content at all times. In order to change static web pages to dynamic ones, it is necessary to implement advanced WML, the subject of this chapter, which requires support from external programs containing procedural languages. There are several methods available for calling external programs the two most common being: • PHP (Hypertext Preprocessor): PHP is a server-side, cross-platform, HTML embedded scripting language that allows programmers to create dynamic web pages. In an HTML document, PHP script (with a similar syntax to that of Perl or C) is enclosed within special PHP tags. Because PHP is embedded within tags, it is possible to jump between HTML and PHP (as in ASP and Cold Fusion) rather than relying on heavy amounts of code to output HTML. PHP is executed on the server, so the client cannot view the PHP code. PHP can perform any task that a CGI program can, and PHP-enabled Web pages can be created and edited just like regular HTML pages. • ASP.NET (Active Server Pages): ASP.NET is a free technology from Microsoft that allows programmers to create dynamic web applications. An ASP.NET file can contain text, HTML tags and scripts. Scripts in an ASP.NET file are executed on the server. ASP can be used to create web applications ranging from small, personal websites through to large, enterprise-class web applications. This chapter will focus on applications that use CGI because of its simplicity.
Chapter Preview
Top

Introduction

Chapter VI discusses the creation of static web pages, which have a fixed content at all times. In order to change static web pages to dynamic ones, it is necessary to implement advanced WML, the subject of this chapter, which requires support from external programs containing procedural languages. There are several methods available for calling external programs the two most common being:

  • PHP (Hypertext Preprocessor): PHP is a server-side, cross-platform, HTML embedded scripting language that allows programmers to create dynamic web pages. In an HTML document, PHP script (with a similar syntax to that of Perl or C) is enclosed within special PHP tags. Because PHP is embedded within tags, it is possible to jump between HTML and PHP (as in ASP and Cold Fusion) rather than relying on heavy amounts of code to output HTML. PHP is executed on the server, so the client cannot view the PHP code. PHP can perform any task that a CGI program can, and PHP-enabled Web pages can be created and edited just like regular HTML pages.

  • ASP.NET (Active Server Pages): ASP.NET is a free technology from Microsoft that allows programmers to create dynamic web applications. An ASP.NET file can contain text, HTML tags and scripts. Scripts in an ASP.NET file are executed on the server. ASP can be used to create web applications ranging from small, personal websites through to large, enterprise-class web applications.

This chapter will focus on applications that use CGI because of its simplicity.

Top

Cgi (Common Gateway Interface)

CGI [W3C (World Wide Web Consortium), 1999] is a standard for running external programs from a World Wide Web HTTP server. CGI specifies how to pass arguments to the executing program as part of the HTTP request and defines a set of environment variables. For most mobile commerce applications, the program generates WML pages that are then passed back to the browser. CGI allows the returned WML (or other document types) to depend in any arbitrary way on the request, and a CGI program can be any program that can accept command-line arguments. Perl is a common choice for writing CGI scripts because it is good at string processing and most Web applications are string-related. Some HTTP servers require CGI programs to reside in a special directory, often “/cgi-bin/.”

A CGI Script

Figure 1 shows the top part of a CGI script, which performs the following two tasks:

Figure 1.

A sample of the top part of a CGI script

978-1-59140-769-0.ch007.f01
  • 1.

    Informs the Web server about the script type and content type, and prints the WML header information, and

  • 2.

    Retrieves the user entry data from the Web and converts it into $FORM variables.

The remainder of the CGI script can be made up of any kind of processing or could call other programs. It usually calls a program of a host language with embedded-SQL, such as JDBC, or a 3G language, such as C.

Complete Chapter List

Search this Book:
Reset