Page 1 of 1

PHP and WAP

Posted: Tue Jun 25, 2002 4:03 am
by nw
:?: How to generate WAP-file with PHP help? And can i upload such file to web serwer as PHP-file and read it from mobile? I've uploaded one PHP-file to WEB-server, but i can't view it from mobile. Why? Thanks! 8O

Posted: Tue Jun 25, 2002 5:47 am
by Wayne
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,

Code: Select all

header ("Content-Type: text/vnd.wap.wml");
should do it. You should also need this specified in the servers MIME-type file.

Posted: Tue Jun 25, 2002 7:51 am
by mikeq
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>