tags:

views:

181

answers:

3

I am a newbie in Wap/Wml. I have to develop a certain portion of existing php/mysql website so that people can access certain information from their mobile phone. I have the following doubts:

1) In which language should I deveop this mobile portion? I am guessing WML. But if I develop it in WML, will it wok in all mobiles?

2) I don't own a mobile that can access internet. Is there a software where i can see my wml pages? So that i would know that it is working and looking nice?

3) My wml page will have a form where person can login and access few private data. Does cookie work in mobile?

4) And also my wml page will have to connect to php page to retrieve some data from MySQL. My question is that can I write wml page from php?

As you can see i am very confuse please help.

Thanks in advance.

+1  A: 
  1. There are many devices that can handle XHTML - but most will also accept WML.
  2. See OpenWave emulator as an example - there are many out there.
  3. As a principal - yes, but some may not...
  4. Not relevant - WML is the markup that the device will receive after the PHP is done working (the output will be in WML instead of using HTML as usual in web development)

I suggest you read up on WML at w3schools and on mobile development at mobiforge.

Dror
+1  A: 

I have developed a couple of applications in the past using php and wml and will share some of the things I encountered.

1) You can use wml for the interface but has limited functionality while the xhtml mobile profile allows you to do more with your wap site, before committing to wml I would say spend some time exploring xhtml mobile profile.

Or you can develop your site to accommodate both wml and xhtml and use a library like http://wurfl.sourceforge.net/ to determine the phone that is accessing your site and what features it supports with xhtml primary and wml as failover.

2) The is firefox extension which you can add to view wml pages with firefox or you can use opera which supports wml natively.

3) I have never used cookies on the wml platform and I would not recommend it, I used $_SESSIONS to track the movement between the pages.

4) you can write your code in php and have the output in wml, you just have to add headers to let the browser know that it's wml.

header("Content-type: text/vnd.wap.wml"); 
 echo "<?xml version=\"1.0\"?>\n";
 echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\"&gt;";

I have uploaded a php test script you can play with thats outputs in wml, I had a hard time adding the code to the post so I opted to upload the file. http://www.devbox.co.za/exp/test.wml.tar

Please Should you decide to go wml please keep in mind that the language is very scrict and please get an xml validator while working on it. It will say you a lot of time.

I hope this helps , good luck.

Ronald Conco
A: 

I wouldn't go with WML, as the majority of phones coming out today do some form of HTML/XHTML.

Some phones like the Nokia N80 don't even support WML.

In PHP, you can use this framework: HAWHAW http://hawhaw.de It lets you write your page as a bunch of objects and then outputs in either WML or XHTML depending on the device visiting the page.

DEF