PHP and WAP
Moderator: General Moderators
PHP and WAP
You can leave it as a php file on the server, so it will create the page content dynamically when the page is requested.
All you need to do is specify the content-header,
should do it. You should also need this specified in the servers MIME-type file.
All you need to do is specify the content-header,
Code: Select all
header ("Content-Type: text/vnd.wap.wml");Here is a sample wap page, just save it as a .php file. Your webserver must support WAP for this to work, your provider will be able to tell you if it does.
<?php
header("Content-Type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
?>
<wml>
<card id="main" title="My WAP">
<p align="center">
Welcome to<br/>
WAP<br/>
http://www.mysite.com
<br/>
<small></small>
</p>
</card>
</wml>
<?php
header("Content-Type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
?>
<wml>
<card id="main" title="My WAP">
<p align="center">
Welcome to<br/>
WAP<br/>
http://www.mysite.com
<br/>
<small></small>
</p>
</card>
</wml>