How can I use a wml script in php files?

348 Views Asked by At

I'm having problems using a wml script in my wml site, when I try to call a function the browser download the wmls file.

My server has all the mime types for wml

this is an example of my wml code embedded in php file

  <?header("Content-type: text/vnd.wap.wml");?>
  <?echo('<?xml version="1.0" encoding="UTF-8"?>');?>
  <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">
  <wml>
    <card>
      <p>
        <b>WmlScript</b><br/>
        <a href="wmlscriptfile.wmls#helloWorld()">Run WMLScript</a><br/>
        $(message) 
      </p>
    </card>
  </wml>

this is the wmlscript code in wmls file

extern function helloWorld()
{
  WMLBrowser.setVar("message", "Hello World. Welcome to our WMLScript tutorial.");
  WMLBrowser.refresh();
}

I'm trying to insert the wmlscript in a php file changing the mime type in the header but the browser download the file again

<?header("Content-type: text/vnd.wap.wmlscript");?>
1

There are 1 best solutions below

1
feeela On

The point is not about sending the proper MIME type, but having a client that knows how to handle that MIME type.

You need a client/browser that understands what WML is.

There is a Firefox AddOn for Fx 3.5 and 4 – I don't know if it still works with recent Fx versions.

Wikipedia knows that: “As of 2013, WAP use has largely disappeared in Europe and the United States.”