PHPBuilder - Introduction to WML, Apache, and PHP

RSS Twitter

Introduction to WML, Apache, and PHP

by: Mike Johnson
January 18, 2001

Working on a website for my company, I discovered the need for wireless access to my email, stocks and such. Not wanting to pay someone else to give me this information, I decided to develop a wireless site. The information to do this is available on the internet, but it is scattered and hard to come across. I needed the ability to run php scripts, access databases, and other functions that I needed PHP to do for me. This article covers the basics of wml, how to set up your apache server, and php. Covering the basics allows you to set up this environment and then learn the rest on your own.


You will need a little experience with the Apache Web Server, Php and html. As for system requirements, I am using apache 1.3.9, php3, and Red Hat Linux 6.0 for this demonstration. I don't see any problems with setting this up on a windows machine running Apache, and PHP3 or PHP4.
In this article, I am going to walk you through the following areas; intro to wml, setting up apache for wireless appications, and creating your first WML/PHP page. Much of this information has been gathered from across the internet, and some I learned as I tried to put together a working site.

Intro to WML

WML stands for Wireless Markup Language. WAP phone or similar devices are used to view pages written in WML. WML is similar to XML based on it's syntax and scrictness. Anybody who has used html will have no problem learning WML. Many tags and attributes are the same, but there are fewer tags. WML allows the programmer to use variables that allow you to create dynamic content, although for this article we are going to use php as the dynamic language.

WML Basics

In WML you can use many sub-pages (called 'cards') in one WML page (called a 'deck'). Each WML card works like a web page and its content is displayed to the user. The following will be our first example of a .wml page. On my server, I saved this file in ~/wireless/home.wml.
<card id='home'>
My first Test page
Unlike HTML, if you do not close your tags, e.g. <wml> </wml> then, your script will not compile correctly. The example above will create a simple test message on any wireless device that says "My first Test page".

Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Mike Johnson



(Maximum characters: 1200). You have characters left.