More and more mobile phones support the WAP function. Therefore, you should also consider creating your own WML website. This article first describes how to create a site on the PHP/WML page, apply the MySQL database, and dynamically update the site content, the specific example is
More and more mobile phones support the WAP function. Therefore, you should also consider creating your own WML website. This article first describes how to create a site on the PHP/WML page, apply the MySQL database, and dynamically update the site content, the specific example is the teaching time and test schedule of a professor in a college. It's not complicated at all :-)
Before you begin, prepare the following items:
1. you have installed PHP and MySQL accurately, and have experience in programming the two.
2. you have SQL related knowledge
3. you are running Apache and can write. haccess files; or you are running IIS and you can add mappings (or you can ask the system administrator to help you );
4. you have knowledge about WML;
Well, the first step is to let your server know how to use PHP to process WML files.
Set server
If you are using Apache, you must find a. htaccess file in your Directory. Then, take the following line:
AddType applications/x-httpd-php3. wml
If you cannot find the file, you can add one and add the above lines to your Directory.
For example, if you are using IIS, you must make some corrections. The difference is a little bit lower than that when installing PHP: Check it out. php and. php3 expands the name ING and is. wml performs the same ING.
Generally, you will find that PHP is mapped:
C: \ php \ php4isapi. dll
Or
C: \ php \ php.exe
Preparations
If you are using a Microsoft control system, you can install the NOKIA development kit. It can check your syntax and allow you to preview the WML page through a phone-like interface. this toolkit also contains reference documents on WML and WML scripts. If your phone does not support WAP, or you cannot apply a WAP gateway, this can be a great help.
To download this tool, you must first register (http://www.forum.nokia.com/main/0,6668,1_1_4,00.html) on this website as a WAP developer ), remember that you need the support of Java2 Runtime Enviroment (support of Java2 Runtime environment ). You can use any text editor to write pages.
Create a MySQL table before writing any PHP/WML code.
The database consists of four tables.
1. the professors table contains the professor's coherent data;
2. the subjucts table contains the coherent data of the topic;
3. the exams table contains test-related data;
4. the teach table contains the relationship information between the professor and the subjects they have granted.
When connecting to MySQL, you can use the following code to create a table
Create table professors (
Id int (11) DEFAULT '0' not null auto_increment,
Surname varchar (24) not null,
Name varchar (24) not null,
Email varchar (48) DEFAULT 'Not avaliable ',
Cod_course varchar (16) DEFAULT 'Not avaliable ',
Consulting_hour varchar (128) DEFAULT 'Not avaliable ',
Consulting_place varchar (128) DEFAULT 'Not avaliable ',
Primary key (Id)
);
These statements establish the table structure of professors. ID is assigned a unique identification name for each professor and is the primary key of the table. Other fields, Surname, Name, and Email are used to indicate the last Name, Name, and e-mail address of each professor. Cod_course uniquely identifies the value of each subject. At last, Consulting_hour and Consulting_place show the teaching time and place.