Jūs esateŽurnalai / Ernestas Kardzys's blog / PHP & WML. How to create a web page for the mobile phone
PHP & WML. How to create a web page for the mobile phone
I have Sony Ericsson K550i mobile phone. And I decided to create a small web page. I know PHP a little, so I was creating the web page on PHP.
The main point is to add a WML header for the web page. Code is as fallows:
header("Content-type: text/vnd.wap.wml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";So, we have this. Then we need other parts:
echo '<wml><card id="cool_page" title="The Title Of My Awesome Page">';<wml> is something like <html> in HTML. Then lets create a web page:
echo '<table border="1"> <tr><td><b>Name</b></td><td><b>Price</b></td></tr> <tr><td>Candy</td><td>15.3</td></tr> <tr><td>Chocolate</td><td>6.6</td></tr> <tr><td>Sugar</td><td>0.23</td></tr> </table>';And at the end we finish the document:
echo '</card></wml>';As a result, our web page looks like that:
<?php header("Content-type: text/vnd.wap.wml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"" . " \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"; echo '<wml><card id="cool_page" title="The Title Of My Awesome Page">'; echo '<table border="1"> <tr><td><b>Name</b></td><td><b>Price</b></td></tr> <tr><td>Candy</td><td>15.3</td></tr> <tr><td>Chocolate</td><td>6.6</td></tr> <tr><td>Sugar</td><td>0.23</td></tr> </table> </card> </wml>' ?>There is one very cool plugin for Mozilla Firefox, if you want to test it. It's called: wmlbrowser. Just point to Tools->Add-ons. Or you can test it in your mobile phone, if it supports WAP :) Good luck ;)


Teisybė ;)
Tačiau čia tik pavyzdys. Aš tau permesiu kitą, mano pagamintą produktą :)
Šiaip tokiam puslapiui sukurti php nereikalingas, nes nieko iš duomenų bazės negeneruoji :)
thanks ;-)
Skelbti naują komentarą