Inserting PHP into a WML document
Any WML document containing PHP must have the following lines of code (known as a prolog) placed at the very top of the deck:
<?php
// send wml headers
header("Content-type: text/vnd.wap.wml");
echo("<?xml version=\"1.0\"?>");
echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. "http://www.wapforum.org/DTD/wml_1.1.xml\">");
?>
This is necessary because PHP will, by default, send the line Content-type: text/html
. By using PHP's header()
function, however, it is possible to suppress this line, thereby sending the correct (wml) one, instead.
0 Comments:
Post a Comment
<< Home