Zend - The PHP Company




HTTP

Add Code


Displaying WML pages with PHP  

Type: code fragment
Added by: shane39
Entered: 13/06/2001
Last modified: 06/12/2000
Rating: - (fewer than 3 votes)
Views: 5929
How to display PHP powered WML pages for wireless use in cell phones, PDAs, etc.


<?php
header
("Content-type: text/vnd.wap.wml");

// AUTHOR: Shane Stiles
// WEB SITE: http://www.gate39.com - webzine on Japan
// DATE: 6/14/2001
// PURPOSE: WAP/WML based page in PHP
// NOTES: The trick to making your PHP powered WML page 
//        work is to send the http headers with the
//        proper Content-Type encoding - as seen on the
//        second line. This MUST be the first line sent 
//        across or you'll receive an ugly content 
//        type error.
?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
                  "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
  <card>
   <p>
   <?php echo "Welcome to your PHP based WAP site..."?>
   </p>
  </card>
</wml>


Usage Example




Rate This Script





Search



This Category All Categories