WAP/WML (DO NOT USE)
  Home arrow WAP/WML (DO NOT USE) arrow Page 4 - Introduction to WAP using WML, ASP and PHP
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WAP/WML (DO NOT USE)

Introduction to WAP using WML, ASP and PHP
By: Jean-Baptiste Minchelli
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 8
    2004-04-13

    Table of Contents:
  • Introduction to WAP using WML, ASP and PHP
  • Configuring IIS and Apache
  • Hello World in WMLScript
  • Generating WMLScript with PHP and ASP
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introduction to WAP using WML, ASP and PHP - Generating WMLScript with PHP and ASP


    (Page 4 of 5 )

    It's possible (and extremely easy) to add dynamic content to our WMLScripts using PHP or ASP. As I mentioned earlier, as long as our PHP/ASP scripts output WML only, then they can be called through a WAP device. You don't have to use ASP or PHP however, and you could just as easily code up a WMLScript using Perl, C#, or JSP.

    Think of the possibilities that are available to us by using PHP or ASP to build our WAP applications: databasing, mail servers, LDAP, message queuing, etc. For a script to be WAP compatible, it must output a WML header to the client. It's possible to make Apache/IIS output this header when it receives a request for a WML file, but we can also manually output this header using either ASP or PHP.

    Here's some PHP code that generates WML to output the date:

     <?
    header("Content-Type: text/vnd.wap.wml");
    echo 
    "<?xml version="1.0"

    "
    ; echo ""

     <WML><CARD id=hello>
    Today is <?  
    echo date("m/d/Y"); 


    </CARD></WML>



    Here's some ASP code that generates exactly the sample WMLScript:

     <% Response.contenttype="text/vnd.wap.wml" %><?xml version="1.0"

    <WML><CARD id=hello>
    Today is <%      response.write date    %></CARD></WML>



    It's crucial not to omit the content type information from the top of each script. It's this information that enables the different agents in the protocol to correctly process the message (gateway, browser, etc). The rest of the code is conventional; you insert the ASP/PHP code inside the WML code. You can therefore carry out any processes you want (database access, image generation, etc).

    Here's how the output looked in the OpenWave WAP emulator on my PC:

    Running the PHP script through the OpenWave WAP emulator

    More WAP/WML (DO NOT USE) Articles
    More By Jean-Baptiste Minchelli


     

    WAP/WML (DO NOT USE) ARTICLES

    - Introduction to WAP using WML, ASP and PHP
    - Introduction to Wireless Access Protocol







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek